SnackBarThemeData class

Customizes default property values for SnackBar widgets.

Descendant widgets obtain the current SnackBarThemeData object using Theme.of(context).snackBarTheme. Instances of SnackBarThemeData can be customized with SnackBarThemeData.copyWith.

Typically a SnackBarThemeData is specified as part of the overall Theme with ThemeData.snackBarTheme. The default for ThemeData.snackBarTheme provides all null properties.

All SnackBarThemeData properties are null by default. When null, the SnackBar will provide its own defaults.

See also:

  • ThemeData, which describes the overall theme information for the application.
Mixed in types
Annotations

Constructors

SnackBarThemeData({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.
const

Properties

actionBackgroundColor Color?
Overrides default value for SnackBarAction.backgroundColor.
final
actionOverflowThreshold double?
Overrides the default value for SnackBar.actionOverflowThreshold.
final
actionTextColor Color?
Overrides the default value for SnackBarAction.textColor.
final
backgroundColor Color?
Overrides the default value for SnackBar.backgroundColor.
final
behavior SnackBarBehavior?
Overrides the default value for SnackBar.behavior.
final
closeIconColor Color?
Overrides the default value for SnackBar.closeIconColor.
final
contentTextStyle TextStyle?
Used to configure the DefaultTextStyle for the SnackBar.content widget.
final
disabledActionBackgroundColor Color?
Overrides default value for SnackBarAction..
final
disabledActionTextColor Color?
Overrides the default value for SnackBarAction.disabledTextColor.
final
dismissDirection DismissDirection?
Overrides the default value for SnackBar.dismissDirection.
final
elevation double?
Overrides the default value for SnackBar.elevation.
final
hashCode int
The hash code for this object.
no setteroverride
insetPadding EdgeInsets?
Overrides the default value for SnackBar.margin.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shape ShapeBorder?
Overrides the default value for SnackBar.shape.
final
showCloseIcon bool?
Overrides the default value for SnackBar.showCloseIcon.
final
width double?
Overrides the default value for SnackBar.width.
final

Methods

copyWith({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}) SnackBarThemeData
Creates a copy of this object with the given fields replaced with the new values.
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override

Static Methods

lerp(SnackBarThemeData? a, SnackBarThemeData? b, double t) SnackBarThemeData
Linearly interpolate between two SnackBar Themes.