pub struct SegmentedButtonThemeData {
pub style: Option<ButtonStyle>,
pub selected_icon: Option<WidgetRef>,
}Expand description
Overrides the default values of visual properties for descendant
SegmentedButton widgets.
Descendant widgets obtain the current SegmentedButtonThemeData object with
SegmentedButtonTheme::of. Instances of SegmentedButtonThemeData can
be customized with SegmentedButtonThemeData::copy_with.
Typically a SegmentedButtonThemeData is specified as part of the overall
Theme with ThemeData::segmented_button_theme.
All SegmentedButtonThemeData properties are null by default. When null,
the SegmentedButton computes its own default values, typically based on
the overall theme’s ThemeData::color_scheme, ThemeData::text_theme, and
ThemeData::icon_theme.
Fields§
§style: Option<ButtonStyle>Overrides the SegmentedButton’s default style.
Non-null properties or non-null resolved WidgetStateProperty
values override the default values used by SegmentedButton.
If style is null, then this theme doesn’t override anything.
If ButtonStyle::side is provided, WidgetStateProperty::resolve is used
for the following WidgetStates:
WidgetState::Focused.WidgetState::Hovered.WidgetState::Disabled.WidgetState::Selected.
selected_icon: Option<WidgetRef>Override for SegmentedButton::selected_icon property.
If non-null, then selected_icon will be used instead of default
value for SegmentedButton::selected_icon.
Implementations§
Source§impl SegmentedButtonThemeData
impl SegmentedButtonThemeData
Sourcepub fn new() -> SegmentedButtonThemeData
pub fn new() -> SegmentedButtonThemeData
Creates a SegmentedButtonThemeData that can be used to override default properties
in a SegmentedButtonTheme widget.
Sourcepub fn style(self, style: ButtonStyle) -> SegmentedButtonThemeData
pub fn style(self, style: ButtonStyle) -> SegmentedButtonThemeData
Dart SegmentedButtonThemeData(style:).
Sourcepub fn selected_icon<K>(
self,
selected_icon: impl IntoWidget<K>,
) -> SegmentedButtonThemeData
pub fn selected_icon<K>( self, selected_icon: impl IntoWidget<K>, ) -> SegmentedButtonThemeData
Dart SegmentedButtonThemeData(selectedIcon:).
Sourcepub fn copy_with(&self) -> SegmentedButtonThemeData
pub fn copy_with(&self) -> SegmentedButtonThemeData
Creates a copy of this object with the given fields replaced with the new values.
Dart’s named arguments are the fluent setters on the copy
(data.copy_with().style(style)).
Sourcepub fn lerp(
a: Option<&SegmentedButtonThemeData>,
b: Option<&SegmentedButtonThemeData>,
t: f64,
) -> SegmentedButtonThemeData
pub fn lerp( a: Option<&SegmentedButtonThemeData>, b: Option<&SegmentedButtonThemeData>, t: f64, ) -> SegmentedButtonThemeData
Linearly interpolates between two segmented button themes.
Trait Implementations§
Source§impl Clone for SegmentedButtonThemeData
impl Clone for SegmentedButtonThemeData
Source§impl Debug for SegmentedButtonThemeData
impl Debug for SegmentedButtonThemeData
Source§impl Default for SegmentedButtonThemeData
impl Default for SegmentedButtonThemeData
Source§impl Diagnosticable for SegmentedButtonThemeData
impl Diagnosticable for SegmentedButtonThemeData
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:).Source§impl Display for SegmentedButtonThemeData
impl Display for SegmentedButtonThemeData
Source§impl PartialEq for SegmentedButtonThemeData
A widget is equal to the widget it is: selectedIcon compares by identity.
impl PartialEq for SegmentedButtonThemeData
A widget is equal to the widget it is: selectedIcon compares by identity.
Source§impl SegmentedButtonThemeDataGetters for SegmentedButtonThemeData
impl SegmentedButtonThemeDataGetters for SegmentedButtonThemeData
super(...)
arguments a defaults struct keeps.Source§fn copy_with(&self, app: &mut App) -> SegmentedButtonThemeData
fn copy_with(&self, app: &mut App) -> SegmentedButtonThemeData
copyWith() with no arguments: a plain value holding what every getter
answers, for the caller’s setters to change.