pub struct ElevatedButtonThemeData {
pub style: Option<ButtonStyle>,
pub variant: Option<StyleVariant>,
}Expand description
A ButtonStyle that overrides the default appearance of
ElevatedButtons when it’s used with ElevatedButtonTheme or with the
overall Theme’s ThemeData::elevated_button_theme.
The style’s properties override ElevatedButton’s default style,
i.e. the ButtonStyle returned by ElevatedButton::default_style_of. Only
the style’s non-null property values or resolved non-null
WidgetStateProperty values are used.
See also:
ElevatedButtonTheme, the theme which is configured with this class.ElevatedButton::default_style_of, which returns the defaultButtonStylefor text buttons.ElevatedButton::style_from, which converts simple values into aButtonStylethat’s consistent withElevatedButton’s defaults.WidgetStateProperty::resolve, “resolve” a material state property to a simple value based on a set ofWidgetStates.ThemeData::elevated_button_theme, which can be used to override the defaultButtonStyleforElevatedButtons below the overallTheme.
Fields§
§style: Option<ButtonStyle>Overrides for ElevatedButton’s default style.
Non-null properties or non-null resolved WidgetStateProperty
values override the ButtonStyle returned by
ElevatedButton::default_style_of.
If style is null, then this theme doesn’t override anything.
variant: Option<StyleVariant>The style variant of Material Design used by ElevatedButton.
Set this to StyleVariant::Material3Expressive to opt elevated buttons
into the Material 3 Expressive style.
If null, the variant is inherited from the closest enclosing
ElevatedButtonTheme that specifies one, and then from
ThemeData::elevated_button_theme. If none of them specify a variant,
ElevatedButton 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 ElevatedButtonTheme takes precedence over
ThemeData::elevated_button_theme, even when a closer Theme specifies a
different variant. This matches ElevatedButtonTheme::of, which only uses
ThemeData::elevated_button_theme when there is no enclosing
ElevatedButtonTheme. To change the variant of a subtree, wrap it in an
ElevatedButtonTheme.
See also:
ElevatedButtonTheme::variant_of, which returns the variant that applies at a given location.
Implementations§
Source§impl ElevatedButtonThemeData
impl ElevatedButtonThemeData
Sourcepub fn new() -> ElevatedButtonThemeData
pub fn new() -> ElevatedButtonThemeData
Creates an ElevatedButtonThemeData.
The style may be null.
Sourcepub fn style(self, style: ButtonStyle) -> ElevatedButtonThemeData
pub fn style(self, style: ButtonStyle) -> ElevatedButtonThemeData
Dart ElevatedButtonThemeData(style:).
Sourcepub fn variant(self, variant: StyleVariant) -> ElevatedButtonThemeData
pub fn variant(self, variant: StyleVariant) -> ElevatedButtonThemeData
Dart ElevatedButtonThemeData(variant:).
Sourcepub fn lerp(
a: Option<&ElevatedButtonThemeData>,
b: Option<&ElevatedButtonThemeData>,
t: f64,
) -> Option<ElevatedButtonThemeData>
pub fn lerp( a: Option<&ElevatedButtonThemeData>, b: Option<&ElevatedButtonThemeData>, t: f64, ) -> Option<ElevatedButtonThemeData>
Linearly interpolate between two elevated button themes.
Trait Implementations§
Source§impl Clone for ElevatedButtonThemeData
impl Clone for ElevatedButtonThemeData
Source§impl Debug for ElevatedButtonThemeData
impl Debug for ElevatedButtonThemeData
Source§impl Default for ElevatedButtonThemeData
impl Default for ElevatedButtonThemeData
Source§impl Diagnosticable for ElevatedButtonThemeData
impl Diagnosticable for ElevatedButtonThemeData
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:).