SnackBarThemeData constructor
- Color? backgroundColor,
- Color? actionTextColor,
- Color? disabledActionTextColor,
- TextStyle? contentTextStyle,
- double? elevation,
- ShapeBorder? shape,
- SnackBarBehavior? behavior,
- double? width,
- EdgeInsets? insetPadding,
- bool? showCloseIcon,
- Color? closeIconColor,
- double? actionOverflowThreshold,
- Color? actionBackgroundColor,
- Color? disabledActionBackgroundColor,
- DismissDirection? dismissDirection,
Creates a theme that can be used for ThemeData.snackBarTheme.
The elevation must be null or non-negative.
Implementation
const SnackBarThemeData({
this.backgroundColor,
this.actionTextColor,
this.disabledActionTextColor,
this.contentTextStyle,
this.elevation,
this.shape,
this.behavior,
this.width,
this.insetPadding,
this.showCloseIcon,
this.closeIconColor,
this.actionOverflowThreshold,
this.actionBackgroundColor,
this.disabledActionBackgroundColor,
this.dismissDirection,
}) : assert(elevation == null || elevation >= 0.0),
assert(width == null || identical(behavior, SnackBarBehavior.floating),
'Width can only be set if behaviour is SnackBarBehavior.floating'),
assert(actionOverflowThreshold == null || (actionOverflowThreshold >= 0 && actionOverflowThreshold <= 1),
'Action overflow threshold must be between 0 and 1 inclusive'),
assert(actionBackgroundColor is! MaterialStateColor || disabledActionBackgroundColor == null,
'disabledBackgroundColor must not be provided when background color is '
'a MaterialStateColor');