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
impl Clone for SwitchTheme
Source§fn clone(&self) -> SwitchTheme
fn clone(&self) -> SwitchTheme
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SwitchTheme
impl Debug for SwitchTheme
Source§impl Default for SwitchTheme
impl Default for SwitchTheme
Source§fn default() -> SwitchTheme
fn default() -> SwitchTheme
Source§impl PartialEq for SwitchTheme
impl PartialEq for SwitchTheme
impl StructuralPartialEq for SwitchTheme
Auto Trait Implementations§
impl Freeze for SwitchTheme
impl RefUnwindSafe for SwitchTheme
impl Send for SwitchTheme
impl Sync for SwitchTheme
impl Unpin for SwitchTheme
impl UnsafeUnpin for SwitchTheme
impl UnwindSafe for SwitchTheme
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.