InfoBarThemeData.standard constructor

InfoBarThemeData.standard(
  1. ThemeData style
)

Implementation

factory InfoBarThemeData.standard(ThemeData style) {
  final isDark = style.brightness == Brightness.dark;
  return InfoBarThemeData(
    padding: EdgeInsets.all(10),
    color: (severity) {
      switch (severity) {
        case InfoBarSeverity.info:
          return style.acrylicBackgroundColor;
        case InfoBarSeverity.warning:
          return isDark ? Color(0xFF433519) : Colors.warningSecondaryColor;
        case InfoBarSeverity.success:
          return isDark ? Color(0xFF393d1b) : Colors.successSecondaryColor;
        case InfoBarSeverity.error:
          return isDark ? Color(0xFF442726) : Colors.errorSecondaryColor;
      }
    },
    closeIcon: FluentIcons.close,
    icon: (severity) {
      switch (severity) {
        case InfoBarSeverity.info:
          return FluentIcons.info;
        case InfoBarSeverity.warning:
          return FluentIcons.error;
        case InfoBarSeverity.success:
          return Icons.check_circle_outlined;
        case InfoBarSeverity.error:
          return FluentIcons.error_badge;
      }
    },
    iconColor: (severity) {
      switch (severity) {
        case InfoBarSeverity.info:
          return isDark ? Colors.grey[120] : Colors.grey[160];
        case InfoBarSeverity.warning:
          return isDark ? Colors.yellow : Colors.warningPrimaryColor;
        case InfoBarSeverity.success:
          return Colors.successPrimaryColor;
        case InfoBarSeverity.error:
          return isDark ? Colors.red : Colors.errorPrimaryColor;
      }
    },
    actionStyle: ButtonThemeData.all(ButtonStyle(
      padding: ButtonState.all(EdgeInsets.all(6)),
    )),
  );
}