SearchBarThemeData class

Defines default property values for descendant SearchBar widgets.

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

Typically a SearchBarThemeData is specified as part of the overall Theme with ThemeData.searchBarTheme.

All SearchBarThemeData properties are null by default. When null, the SearchBar will use the values from ThemeData if they exist, otherwise it will provide its own defaults based on the overall Theme's colorScheme. See the individual SearchBar properties for details.

See also:

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

Constructors

SearchBarThemeData({MaterialStateProperty<double?>? elevation, MaterialStateProperty<Color?>? backgroundColor, MaterialStateProperty<Color?>? shadowColor, MaterialStateProperty<Color?>? surfaceTintColor, MaterialStateProperty<Color?>? overlayColor, MaterialStateProperty<BorderSide?>? side, MaterialStateProperty<OutlinedBorder?>? shape, MaterialStateProperty<EdgeInsetsGeometry?>? padding, MaterialStateProperty<TextStyle?>? textStyle, MaterialStateProperty<TextStyle?>? hintStyle, BoxConstraints? constraints, TextCapitalization? textCapitalization})
Creates a theme that can be used for ThemeData.searchBarTheme.
const

Properties

backgroundColor MaterialStateProperty<Color?>?
Overrides the default value of the SearchBar.backgroundColor.
final
constraints BoxConstraints?
Overrides the value of size constraints for SearchBar.
final
elevation MaterialStateProperty<double?>?
Overrides the default value of the SearchBar.elevation.
final
hashCode int
The hash code for this object.
no setteroverride
hintStyle MaterialStateProperty<TextStyle?>?
Overrides the default value for SearchBar.hintStyle.
final
overlayColor MaterialStateProperty<Color?>?
Overrides the default value of the SearchBar.overlayColor.
final
padding MaterialStateProperty<EdgeInsetsGeometry?>?
Overrides the default value for SearchBar.padding.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowColor MaterialStateProperty<Color?>?
Overrides the default value of the SearchBar.shadowColor.
final
shape MaterialStateProperty<OutlinedBorder?>?
Overrides the default value of the SearchBar.shape.
final
side MaterialStateProperty<BorderSide?>?
Overrides the default value of the SearchBar.side.
final
surfaceTintColor MaterialStateProperty<Color?>?
Overrides the default value of the SearchBar.surfaceTintColor.
final
textCapitalization TextCapitalization?
Overrides the value of SearchBar.textCapitalization.
final
textStyle MaterialStateProperty<TextStyle?>?
Overrides the default value for SearchBar.textStyle.
final

Methods

copyWith({MaterialStateProperty<double?>? elevation, MaterialStateProperty<Color?>? backgroundColor, MaterialStateProperty<Color?>? shadowColor, MaterialStateProperty<Color?>? surfaceTintColor, MaterialStateProperty<Color?>? overlayColor, MaterialStateProperty<BorderSide?>? side, MaterialStateProperty<OutlinedBorder?>? shape, MaterialStateProperty<EdgeInsetsGeometry?>? padding, MaterialStateProperty<TextStyle?>? textStyle, MaterialStateProperty<TextStyle?>? hintStyle, BoxConstraints? constraints, TextCapitalization? textCapitalization}) SearchBarThemeData
Creates a copy of this object but 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(SearchBarThemeData? a, SearchBarThemeData? b, double t) SearchBarThemeData?
Linearly interpolate between two SearchBarThemeDatas.