AppBarTheme class Null safety

Overrides the default values of visual properties for descendant AppBar widgets.

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

Typically an AppBarTheme is specified as part of the overall Theme with ThemeData.appBarTheme.

All AppBarTheme properties are null by default. When null, the AppBar compute its own default values, typically based on the overall theme's ThemeData.colorScheme, ThemeData.textTheme, and ThemeData.iconTheme.

Mixed in types
Annotations

Constructors

AppBarTheme({@Deprecated('This property is no longer used, please use systemOverlayStyle instead. ' 'This feature was deprecated after v2.4.0-0.0.pre.') Brightness? brightness, Color? color, Color? backgroundColor, Color? foregroundColor, double? elevation, double? scrolledUnderElevation, Color? shadowColor, Color? surfaceTintColor, ShapeBorder? shape, IconThemeData? iconTheme, IconThemeData? actionsIconTheme, @Deprecated('This property is no longer used, please use toolbarTextStyle and titleTextStyle instead. ' 'This feature was deprecated after v2.4.0-0.0.pre.') TextTheme? textTheme, bool? centerTitle, double? titleSpacing, double? toolbarHeight, TextStyle? toolbarTextStyle, TextStyle? titleTextStyle, SystemUiOverlayStyle? systemOverlayStyle, @Deprecated('This property is obsolete and is false by default. ' 'This feature was deprecated after v2.4.0-0.0.pre.') bool? backwardsCompatibility})
Creates a theme that can be used for ThemeData.appBarTheme.
const

Properties

actionsIconTheme IconThemeData?
Overrides the default value of AppBar.actionsIconTheme in all descendant AppBar widgets.
final
backgroundColor Color?
Overrides the default value of AppBar.backgroundColor in all descendant AppBar widgets.
final
backwardsCompatibility bool?
Overrides the default value of AppBar.backwardsCompatibility property in all descendant AppBar widgets.
Deprecated('This property is obsolete and is false by default. ' 'This feature was deprecated after v2.4.0-0.0.pre.')">@Deprecated('This property is obsolete and is false by default. ' 'This feature was deprecated after v2.4.0-0.0.pre.')final
brightness Brightness?
This property is deprecated, please use systemOverlayStyle instead.
Deprecated('This property is no longer used, please use systemOverlayStyle instead. ' 'This feature was deprecated after v2.4.0-0.0.pre.')">@Deprecated('This property is no longer used, please use systemOverlayStyle instead. ' 'This feature was deprecated after v2.4.0-0.0.pre.')final
centerTitle bool?
Overrides the default value of AppBar.centerTitle property in all descendant AppBar widgets.
final
color Color?
This property is deprecated, please use backgroundColor instead.
Deprecated('This property is no longer used, please use backgroundColor instead. ' 'This feature was deprecated after v2.4.0-0.0.pre.')">@Deprecated('This property is no longer used, please use backgroundColor instead. ' 'This feature was deprecated after v2.4.0-0.0.pre.')read-only
elevation double?
Overrides the default value of AppBar.elevation in all descendant AppBar widgets.
final
foregroundColor Color?
Overrides the default value of AppBar.foregroundColor in all descendant AppBar widgets.
final
hashCode int
The hash code for this object.
read-onlyoverride
iconTheme IconThemeData?
Overrides the default value of AppBar.iconTheme in all descendant AppBar widgets.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
scrolledUnderElevation double?
Overrides the default value of AppBar.scrolledUnderElevation in all descendant AppBar widgets.
final
shadowColor Color?
Overrides the default value of AppBar.shadowColor in all descendant AppBar widgets.
final
shape ShapeBorder?
Overrides the default value of AppBar.shape in all descendant AppBar widgets.
final
surfaceTintColor Color?
Overrides the default value of AppBar.surfaceTintColor in all descendant AppBar widgets.
final
systemOverlayStyle SystemUiOverlayStyle?
Overrides the default value of AppBar.systemOverlayStyle property in all descendant AppBar widgets.
final
textTheme TextTheme?
This property is deprecated, please use toolbarTextStyle and titleTextStyle instead.
Deprecated('This property is no longer used, please use toolbarTextStyle and titleTextStyle instead. ' 'This feature was deprecated after v2.4.0-0.0.pre.')">@Deprecated('This property is no longer used, please use toolbarTextStyle and titleTextStyle instead. ' 'This feature was deprecated after v2.4.0-0.0.pre.')final
titleSpacing double?
Overrides the default value of the obsolete AppBar.titleSpacing property in all descendant AppBar widgets.
final
titleTextStyle TextStyle?
Overrides the default value of AppBar.titleTextStyle property in all descendant AppBar widgets.
final
toolbarHeight double?
Overrides the default value of the AppBar.toolbarHeight property in all descendant AppBar widgets.
final
toolbarTextStyle TextStyle?
Overrides the default value of the obsolete AppBar.toolbarTextStyle property in all descendant AppBar widgets.
final

Methods

copyWith({IconThemeData? actionsIconTheme, Brightness? brightness, Color? color, Color? backgroundColor, Color? foregroundColor, double? elevation, double? scrolledUnderElevation, Color? shadowColor, Color? surfaceTintColor, ShapeBorder? shape, IconThemeData? iconTheme, TextTheme? textTheme, bool? centerTitle, double? titleSpacing, double? toolbarHeight, TextStyle? toolbarTextStyle, TextStyle? titleTextStyle, SystemUiOverlayStyle? systemOverlayStyle, bool? backwardsCompatibility}) AppBarTheme
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 non-existent 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(AppBarTheme? a, AppBarTheme? b, double t) AppBarTheme
Linearly interpolate between two AppBar themes.
of(BuildContext context) AppBarTheme
The ThemeData.appBarTheme property of the ambient Theme.