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.