Skip to main content

SwitchTheme

Struct SwitchTheme 

Source
pub struct SwitchTheme {
Show 14 fields pub track_color: Option<Color>, pub inactive_track_color: Option<Color>, pub thumb_color: Option<Color>, pub inactive_thumb_color: Option<Color>, pub thumb_colors: Option<WidgetStateProperty<Color>>, pub track_colors: Option<WidgetStateProperty<Color>>, pub track_outline_color: Option<WidgetStateProperty<Color>>, pub track_outline_width: Option<f32>, pub overlay_color: Option<WidgetStateProperty<Color>>, pub splash_radius: Option<f32>, pub padding: Option<Insets>, pub icon_color: Option<Color>, pub inactive_icon_color: Option<Color>, pub tap_target: Option<TapTarget>,
}
Expand description

Defaults for Switch.

Fields§

§track_color: Option<Color>

The track, on.

§inactive_track_color: Option<Color>

The track, off.

§thumb_color: Option<Color>

The thumb, on.

§inactive_thumb_color: Option<Color>

The thumb, off.

§thumb_colors: Option<WidgetStateProperty<Color>>

The thumb in any state, on or off — before thumb_color and inactive_thumb_color (milestone 637).

§track_colors: Option<WidgetStateProperty<Color>>

The track in any state, on or off — before track_color and inactive_track_color.

§track_outline_color: Option<WidgetStateProperty<Color>>

The rule round the track in any state. Unset, outline round an off track and none round an on one.

§track_outline_width: Option<f32>

How wide that rule is. Unset, 2.

§overlay_color: Option<WidgetStateProperty<Color>>

The halo round the thumb, state by state. Unset, primary round an on switch and on_surface round an off one, 8 % under a pointer and 10 % focused or pressed.

§splash_radius: Option<f32>

The halo’s radius. Unset, 20.

§padding: Option<Insets>

The room either side of the track. Unset, 4 left and right.

§icon_color: Option<Color>

The glyph inside the thumb, on. Unset, the scheme’s on_primary_container (switch.dart:2338).

§inactive_icon_color: Option<Color>

The glyph inside the thumb, off. Unset, the scheme’s surface_container_highest (switch.dart:2349) — the track’s own colour, so the glyph reads as a hole in the thumb rather than as a mark on it.

§tap_target: Option<TapTarget>

How much room it reserves for a finger — the reference’s per-widget say over the theme’s (switch.dart:603). Unset, the theme’s own answer.

Trait Implementations§

Source§

impl Clone for SwitchTheme

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 SwitchTheme

Source§

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

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

impl Default for SwitchTheme

Source§

fn default() -> Self

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

impl PartialEq for SwitchTheme

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 SwitchTheme

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<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> 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<Msg> IntoMsg<Msg> for Msg

Source§

fn defer(work: impl Fn() -> Msg + 'static) -> Msg

The message that stands for work’s result.
Source§

impl<T> MaybeSend for T
where T: Send,

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