MaterialBannerThemeData class

Defines the visual properties of MaterialBanner widgets.

Descendant widgets obtain the current MaterialBannerThemeData object using MaterialBannerTheme.of(context). Instances of MaterialBannerThemeData can be customized with MaterialBannerThemeData.copyWith.

Typically a MaterialBannerThemeData is specified as part of the overall Theme with ThemeData.bannerTheme.

All MaterialBannerThemeData properties are null by default. When null, the MaterialBanner will provide its own defaults.

See also:

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

Constructors

MaterialBannerThemeData({Color? backgroundColor, Color? surfaceTintColor, Color? shadowColor, Color? dividerColor, TextStyle? contentTextStyle, double? elevation, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? leadingPadding})
Creates a theme that can be used for MaterialBannerTheme or ThemeData.bannerTheme.
const

Properties

backgroundColor Color?
The background color of a MaterialBanner.
final
contentTextStyle TextStyle?
Used to configure the DefaultTextStyle for the MaterialBanner.content widget.
final
dividerColor Color?
Overrides the default value of MaterialBanner.dividerColor.
final
elevation double?
Default value for MaterialBanner.elevation.
final
hashCode int
The hash code for this object.
no setteroverride
leadingPadding EdgeInsetsGeometry?
The amount of space by which to inset MaterialBanner.leading.
final
padding EdgeInsetsGeometry?
The amount of space by which to inset MaterialBanner.content.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowColor Color?
Overrides the default value of MaterialBanner.shadowColor.
final
surfaceTintColor Color?
Overrides the default value of MaterialBanner.surfaceTintColor.
final

Methods

copyWith({Color? backgroundColor, Color? surfaceTintColor, Color? shadowColor, Color? dividerColor, TextStyle? contentTextStyle, double? elevation, EdgeInsetsGeometry? padding, EdgeInsetsGeometry? leadingPadding}) MaterialBannerThemeData
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(MaterialBannerThemeData? a, MaterialBannerThemeData? b, double t) MaterialBannerThemeData
Linearly interpolate between two Banner themes.