InfoBarThemeData.standard constructor
InfoBarThemeData.standard(
- FluentThemeData theme
Implementation
factory InfoBarThemeData.standard(FluentThemeData theme) {
return InfoBarThemeData(
padding: const EdgeInsetsDirectional.only(
top: 14.0,
bottom: 14.0,
start: 14.0,
end: 8.0,
),
decoration: (severity) {
late Color color;
switch (severity) {
case InfoBarSeverity.info:
color = theme.resources.systemFillColorAttentionBackground;
break;
case InfoBarSeverity.warning:
color = theme.resources.systemFillColorCautionBackground;
break;
case InfoBarSeverity.success:
color = theme.resources.systemFillColorSuccessBackground;
break;
case InfoBarSeverity.error:
color = theme.resources.systemFillColorCriticalBackground;
break;
}
return BoxDecoration(
color: color,
borderRadius: BorderRadius.circular(4.0),
border: Border.all(
color: theme.resources.cardStrokeColorDefault,
),
);
},
closeIcon: FluentIcons.chrome_close,
icon: (severity) {
switch (severity) {
case InfoBarSeverity.info:
return FluentIcons.info_solid;
case InfoBarSeverity.warning:
return FluentIcons.critical_error_solid;
case InfoBarSeverity.success:
return Icons.check_circle;
case InfoBarSeverity.error:
return Icons.cancel;
}
},
iconColor: (severity) {
switch (severity) {
case InfoBarSeverity.info:
return theme.accentColor.defaultBrushFor(theme.brightness);
case InfoBarSeverity.warning:
return theme.resources.systemFillColorCaution;
case InfoBarSeverity.success:
return theme.resources.systemFillColorSuccess;
case InfoBarSeverity.error:
return theme.resources.systemFillColorCritical;
}
},
actionStyle: ButtonStyle(
padding: ButtonState.all(const EdgeInsets.all(6)),
),
closeButtonStyle: ButtonStyle(iconSize: ButtonState.all(16.0)),
);
}