pub struct IconButtonThemeData {
pub style: Option<ButtonStyle>,
pub variant: Option<StyleVariant>,
}Expand description
A ButtonStyle that overrides the default appearance of
IconButtons when it’s used with the IconButton, the IconButtonTheme or the
overall Theme’s ThemeData::icon_button_theme.
The IconButton will be affected by IconButtonTheme and IconButtonThemeData
only if ThemeData::use_material3 is set to true; otherwise, IconTheme will be used.
The style’s properties override IconButton’s default style. Only
the style’s non-null property values or resolved non-null
WidgetStateProperty values are used.
See also:
IconButtonTheme, the theme which is configured with this class.IconButton::style_from, which converts simple values into aButtonStylethat’s consistent withIconButton’s defaults.WidgetStateProperty::resolve, “resolve” a material state property to a simple value based on a set ofWidgetStates.ThemeData::icon_button_theme, which can be used to override the defaultButtonStyleforIconButtons below the overallTheme.
Fields§
§style: Option<ButtonStyle>Overrides for IconButton’s default style if ThemeData::use_material3
is set to true.
Non-null properties or non-null resolved WidgetStateProperty
values override the default ButtonStyle in IconButton.
If style is null, then this theme doesn’t override anything.
variant: Option<StyleVariant>The style variant of Material Design used by IconButton.
Set this to StyleVariant::Material3Expressive to opt icon buttons into
the Material 3 Expressive style.
If null, the variant is inherited from the closest enclosing
IconButtonTheme that specifies one, and then from
ThemeData::icon_button_theme. If none of them specify a variant,
IconButton uses StyleVariant::Material3. To keep a subtree on
Material 3 when an ancestor opts into Material 3 Expressive, set this to
StyleVariant::Material3.
An enclosing IconButtonTheme takes precedence over
ThemeData::icon_button_theme, even when a closer Theme specifies a
different variant. This matches IconButtonTheme::of, which only uses
ThemeData::icon_button_theme when there is no enclosing IconButtonTheme.
To change the variant of a subtree, wrap it in an IconButtonTheme.
See also:
IconButtonTheme::variant_of, which returns the variant that applies at a given location.
Implementations§
Source§impl IconButtonThemeData
impl IconButtonThemeData
Sourcepub fn new() -> IconButtonThemeData
pub fn new() -> IconButtonThemeData
Creates a IconButtonThemeData.
The style may be null.
Sourcepub fn style(self, style: ButtonStyle) -> IconButtonThemeData
pub fn style(self, style: ButtonStyle) -> IconButtonThemeData
Dart IconButtonThemeData(style:).
Sourcepub fn variant(self, variant: StyleVariant) -> IconButtonThemeData
pub fn variant(self, variant: StyleVariant) -> IconButtonThemeData
Dart IconButtonThemeData(variant:).
Sourcepub fn lerp(
a: Option<&IconButtonThemeData>,
b: Option<&IconButtonThemeData>,
t: f64,
) -> Option<IconButtonThemeData>
pub fn lerp( a: Option<&IconButtonThemeData>, b: Option<&IconButtonThemeData>, t: f64, ) -> Option<IconButtonThemeData>
Linearly interpolate between two icon button themes.
Trait Implementations§
Source§impl Clone for IconButtonThemeData
impl Clone for IconButtonThemeData
Source§impl Debug for IconButtonThemeData
impl Debug for IconButtonThemeData
Source§impl Default for IconButtonThemeData
impl Default for IconButtonThemeData
Source§impl Diagnosticable for IconButtonThemeData
impl Diagnosticable for IconButtonThemeData
Source§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
Source§fn type_name(&self) -> &'static str
fn type_name(&self) -> &'static str
Object.runtimeType as diagnostics print it: the last segment of
the Rust type path, without generic arguments.Source§fn identity_hash(&self) -> u64
fn identity_hash(&self) -> u64
Object.hashCode as diagnostics print it: the object’s address.Source§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
Source§fn to_diagnostics_node(&self) -> DiagnosticableNode
fn to_diagnostics_node(&self) -> DiagnosticableNode
DiagnosticsNode::to_string_deep.Source§fn to_diagnostics_node_with(
&self,
name: Option<String>,
style: Option<DiagnosticsTreeStyle>,
) -> DiagnosticableNode
fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode
toDiagnosticsNode(name:, style:).Source§fn to_string(&self) -> String
fn to_string(&self) -> String
toString: a single-line description with properties and no
children. Read moreSource§fn to_string_at(&self, min_level: DiagnosticLevel) -> String
fn to_string_at(&self, min_level: DiagnosticLevel) -> String
toString(minLevel:).