Skip to main content

ToggleButtonsThemeData

Struct ToggleButtonsThemeData 

Source
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:

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

Source

pub fn new() -> ToggleButtonsThemeData

Creates the set of color and border properties used to configure ToggleButtons.

Source

pub fn text_style(self, text_style: TextStyle) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(textStyle:).

Source

pub fn constraints(self, constraints: BoxConstraints) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(constraints:).

Source

pub fn color(self, color: Color) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(color:).

Source

pub fn selected_color(self, selected_color: Color) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(selectedColor:).

Source

pub fn disabled_color(self, disabled_color: Color) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(disabledColor:).

Source

pub fn fill_color( self, fill_color: impl Into<AnyColor>, ) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(fillColor:).

Source

pub fn focus_color(self, focus_color: Color) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(focusColor:).

Source

pub fn highlight_color(self, highlight_color: Color) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(highlightColor:).

Source

pub fn hover_color(self, hover_color: Color) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(hoverColor:).

Source

pub fn splash_color(self, splash_color: Color) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(splashColor:).

Source

pub fn border_color(self, border_color: Color) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(borderColor:).

Source

pub fn selected_border_color( self, selected_border_color: Color, ) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(selectedBorderColor:).

Source

pub fn disabled_border_color( self, disabled_border_color: Color, ) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(disabledBorderColor:).

Source

pub fn border_radius( self, border_radius: BorderRadius, ) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(borderRadius:).

Source

pub fn border_width(self, border_width: f64) -> ToggleButtonsThemeData

Dart ToggleButtonsThemeData(borderWidth:).

Source

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)).

Source

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

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ToggleButtonsThemeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ToggleButtonsThemeData

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Diagnosticable for ToggleButtonsThemeData

Source§

fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)

Add additional properties associated with the node.
Source§

fn type_name(&self) -> &'static str

Dart’s Object.runtimeType as diagnostics print it: the last segment of the Rust type path, without generic arguments.
Source§

fn identity_hash(&self) -> u64

Dart’s Object.hashCode as diagnostics print it: the object’s address.
Source§

fn to_string_short(&self) -> String

A brief description of this object, usually just the type and the hash.
Source§

fn to_diagnostics_node(&self) -> DiagnosticableNode

Returns a debug representation of the object used by debugging tools and by DiagnosticsNode::to_string_deep.
Source§

fn to_diagnostics_node_with( &self, name: Option<String>, style: Option<DiagnosticsTreeStyle>, ) -> DiagnosticableNode

Dart toDiagnosticsNode(name:, style:).
Source§

fn to_string(&self) -> String

Dart’s toString: a single-line description with properties and no children. Read more
Source§

fn to_string_at(&self, min_level: DiagnosticLevel) -> String

Dart’s toString(minLevel:).
Source§

impl Display for ToggleButtonsThemeData

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for ToggleButtonsThemeData

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ToggleButtonsThemeData

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>