pub struct ToggleButtonsThemeData {Show 15 fields
pub text_style: Option<TextStyle>,
pub constraints: Option<BoxConstraints>,
pub color: Option<Color>,
pub selected_color: Option<Color>,
pub disabled_color: Option<Color>,
pub fill_color: Option<AnyColor>,
pub focus_color: Option<Color>,
pub highlight_color: Option<Color>,
pub hover_color: Option<Color>,
pub splash_color: Option<Color>,
pub border_color: Option<Color>,
pub selected_border_color: Option<Color>,
pub disabled_border_color: Option<Color>,
pub border_radius: Option<BorderRadius>,
pub border_width: Option<f64>,
}Expand description
Defines default property values for descendant ToggleButtons widgets.
Descendant widgets obtain the current ToggleButtonsThemeData object using
ToggleButtonsTheme::of. Instances of ToggleButtonsThemeData can be customized
with ToggleButtonsThemeData::copy_with.
Typically a ToggleButtonsThemeData is specified as part of the overall Theme
with ThemeData::toggle_buttons_theme.
All ToggleButtonsThemeData properties are None by default. When null, the
ToggleButtons will use the values from ThemeData if they exist, otherwise it will
provide its own defaults based on the overall Theme’s ThemeData::text_theme and
ThemeData::color_scheme. See the individual ToggleButtons properties for details.
See also:
ToggleButtonsTheme, which describes the actual configuration of a toggle buttons theme.
Fields§
§text_style: Option<TextStyle>The default text style for ToggleButtons::children.
TextStyle::color will be ignored and substituted by color,
selected_color or disabled_color
depending on whether the buttons are active, selected, or disabled.
constraints: Option<BoxConstraints>Defines the button’s size.
Typically used to constrain the button’s minimum size.
color: Option<Color>The color for descendant Text and Icon widgets if the button is enabled and not selected.
selected_color: Option<Color>The color for descendant Text and Icon widgets if the button is selected.
disabled_color: Option<Color>The color for descendant Text and Icon widgets if the button is disabled.
fill_color: Option<AnyColor>The fill color for selected toggle buttons.
It can be a WidgetStateColor, which then resolves in the WidgetState::Selected and
WidgetState::Disabled states.
focus_color: Option<Color>The color to use for filling the button when the button has input focus.
highlight_color: Option<Color>The highlight color for the button’s InkWell.
hover_color: Option<Color>The color to use for filling the button when the button has a pointer hovering over it.
splash_color: Option<Color>The splash color for the button’s InkWell.
border_color: Option<Color>The border color to display when the toggle button is enabled.
selected_border_color: Option<Color>The border color to display when the toggle button is selected.
disabled_border_color: Option<Color>The border color to display when the toggle button is disabled.
border_radius: Option<BorderRadius>The radii of the border’s corners.
border_width: Option<f64>The width of the border surrounding each toggle button.
This applies to both the greater surrounding border, as well as the borders dividing each toggle button.
To render a hairline border (one physical pixel), set border_width to 0.0.
See [BorderSide::width] for more details on hairline borders.
Implementations§
Source§impl ToggleButtonsThemeData
impl ToggleButtonsThemeData
Sourcepub fn new() -> ToggleButtonsThemeData
pub fn new() -> ToggleButtonsThemeData
Creates the set of color and border properties used to configure ToggleButtons.
Sourcepub fn text_style(self, text_style: TextStyle) -> ToggleButtonsThemeData
pub fn text_style(self, text_style: TextStyle) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(textStyle:).
Sourcepub fn constraints(self, constraints: BoxConstraints) -> ToggleButtonsThemeData
pub fn constraints(self, constraints: BoxConstraints) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(constraints:).
Sourcepub fn color(self, color: Color) -> ToggleButtonsThemeData
pub fn color(self, color: Color) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(color:).
Sourcepub fn selected_color(self, selected_color: Color) -> ToggleButtonsThemeData
pub fn selected_color(self, selected_color: Color) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(selectedColor:).
Sourcepub fn disabled_color(self, disabled_color: Color) -> ToggleButtonsThemeData
pub fn disabled_color(self, disabled_color: Color) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(disabledColor:).
Sourcepub fn fill_color(
self,
fill_color: impl Into<AnyColor>,
) -> ToggleButtonsThemeData
pub fn fill_color( self, fill_color: impl Into<AnyColor>, ) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(fillColor:).
Sourcepub fn focus_color(self, focus_color: Color) -> ToggleButtonsThemeData
pub fn focus_color(self, focus_color: Color) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(focusColor:).
Sourcepub fn highlight_color(self, highlight_color: Color) -> ToggleButtonsThemeData
pub fn highlight_color(self, highlight_color: Color) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(highlightColor:).
Sourcepub fn hover_color(self, hover_color: Color) -> ToggleButtonsThemeData
pub fn hover_color(self, hover_color: Color) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(hoverColor:).
Sourcepub fn splash_color(self, splash_color: Color) -> ToggleButtonsThemeData
pub fn splash_color(self, splash_color: Color) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(splashColor:).
Sourcepub fn border_color(self, border_color: Color) -> ToggleButtonsThemeData
pub fn border_color(self, border_color: Color) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(borderColor:).
Sourcepub fn selected_border_color(
self,
selected_border_color: Color,
) -> ToggleButtonsThemeData
pub fn selected_border_color( self, selected_border_color: Color, ) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(selectedBorderColor:).
Sourcepub fn disabled_border_color(
self,
disabled_border_color: Color,
) -> ToggleButtonsThemeData
pub fn disabled_border_color( self, disabled_border_color: Color, ) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(disabledBorderColor:).
Sourcepub fn border_radius(
self,
border_radius: BorderRadius,
) -> ToggleButtonsThemeData
pub fn border_radius( self, border_radius: BorderRadius, ) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(borderRadius:).
Sourcepub fn border_width(self, border_width: f64) -> ToggleButtonsThemeData
pub fn border_width(self, border_width: f64) -> ToggleButtonsThemeData
Dart ToggleButtonsThemeData(borderWidth:).
Sourcepub fn copy_with(&self) -> ToggleButtonsThemeData
pub fn copy_with(&self) -> ToggleButtonsThemeData
Creates a copy of this object but with the given fields replaced with the new values.
Dart’s named arguments are the fluent setters on the copy
(data.copy_with().color(color)).
Sourcepub fn lerp(
a: Option<&ToggleButtonsThemeData>,
b: Option<&ToggleButtonsThemeData>,
t: f64,
) -> Option<ToggleButtonsThemeData>
pub fn lerp( a: Option<&ToggleButtonsThemeData>, b: Option<&ToggleButtonsThemeData>, t: f64, ) -> Option<ToggleButtonsThemeData>
Linearly interpolate between two toggle buttons themes.
Trait Implementations§
Source§impl Clone for ToggleButtonsThemeData
impl Clone for ToggleButtonsThemeData
Source§impl Debug for ToggleButtonsThemeData
impl Debug for ToggleButtonsThemeData
Source§impl Default for ToggleButtonsThemeData
impl Default for ToggleButtonsThemeData
Source§impl Diagnosticable for ToggleButtonsThemeData
impl Diagnosticable for ToggleButtonsThemeData
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:).