SnackBarThemeData constructor

const SnackBarThemeData({
  1. Color? backgroundColor,
  2. Color? actionTextColor,
  3. Color? disabledActionTextColor,
  4. TextStyle? contentTextStyle,
  5. double? elevation,
  6. ShapeBorder? shape,
  7. SnackBarBehavior? behavior,
  8. double? width,
  9. EdgeInsets? insetPadding,
  10. bool? showCloseIcon,
  11. Color? closeIconColor,
  12. double? actionOverflowThreshold,
  13. Color? actionBackgroundColor,
  14. Color? disabledActionBackgroundColor,
  15. 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');