pub struct SwitchThemeData {
pub thumb_color: Option<WidgetStatePropertyRef<Option<Color>>>,
pub track_color: Option<WidgetStatePropertyRef<Option<Color>>>,
pub track_outline_color: Option<WidgetStatePropertyRef<Option<Color>>>,
pub track_outline_width: Option<WidgetStatePropertyRef<Option<f64>>>,
pub material_tap_target_size: Option<MaterialTapTargetSize>,
pub mouse_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>,
pub overlay_color: Option<WidgetStatePropertyRef<Option<Color>>>,
pub splash_radius: Option<f64>,
pub thumb_icon: Option<WidgetStatePropertyRef<Option<Rc<Icon>>>>,
pub padding: Option<EdgeInsetsGeometry>,
}Expand description
Defines default property values for descendant Switch widgets.
Descendant widgets obtain the current SwitchThemeData object using
SwitchTheme::of. Instances of SwitchThemeData can be customized
with SwitchThemeData::copy_with.
Typically a SwitchThemeData is specified as part of the overall Theme
with ThemeData::switch_theme.
All SwitchThemeData properties are None by default. When None, the
Switch will use the values from ThemeData if they exist, otherwise it
will provide its own defaults based on the overall Theme’s color_scheme.
See the individual Switch properties for details.
See also:
ThemeData, which describes the overall theme information for the application.
Fields§
§thumb_color: Option<WidgetStatePropertyRef<Option<Color>>>The color of a Switch’s thumb, resolved in the selected, hovered, focused and
disabled states.
If specified, overrides the default value of Switch::thumb_color.
track_color: Option<WidgetStatePropertyRef<Option<Color>>>The color of a Switch’s track, resolved in the selected, hovered, focused and
disabled states.
If specified, overrides the default value of Switch::track_color.
track_outline_color: Option<WidgetStatePropertyRef<Option<Color>>>The outline color of a Switch’s track, resolved in the selected, hovered, focused
and disabled states.
If specified, overrides the default value of Switch::track_outline_color.
track_outline_width: Option<WidgetStatePropertyRef<Option<f64>>>The outline width of a Switch’s track, resolved in the selected, hovered, focused
and disabled states.
If specified, overrides the default value of Switch::track_outline_width.
material_tap_target_size: Option<MaterialTapTargetSize>Configures the minimum size of the tap target.
If specified, overrides the default value of
Switch::material_tap_target_size.
mouse_cursor: Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>The cursor for a mouse pointer when it enters or is hovering over the widget, resolved in the selected, hovered, focused and disabled states.
If specified, overrides the default value of Switch::mouse_cursor.
overlay_color: Option<WidgetStatePropertyRef<Option<Color>>>The color for the switch’s Material, resolved in the pressed, selected, hovered
and focused states.
If specified, overrides the default value of Switch::overlay_color.
splash_radius: Option<f64>The splash radius of the circular Material ink response.
If specified, overrides the default value of Switch::splash_radius.
thumb_icon: Option<WidgetStatePropertyRef<Option<Rc<Icon>>>>The icon to use on the thumb of a switch, resolved in the selected, hovered, focused and disabled states.
It is overridden by Switch::thumb_icon.
padding: Option<EdgeInsetsGeometry>If specified, overrides the default value of Switch::padding.
Implementations§
Source§impl SwitchThemeData
impl SwitchThemeData
Sourcepub fn new() -> SwitchThemeData
pub fn new() -> SwitchThemeData
Creates a theme that can be used for ThemeData::switch_theme; Dart’s optional named
arguments are the fluent setters.
Sourcepub fn thumb_color(
self,
thumb_color: WidgetStatePropertyRef<Option<Color>>,
) -> SwitchThemeData
pub fn thumb_color( self, thumb_color: WidgetStatePropertyRef<Option<Color>>, ) -> SwitchThemeData
Dart SwitchThemeData(thumbColor:).
Sourcepub fn track_color(
self,
track_color: WidgetStatePropertyRef<Option<Color>>,
) -> SwitchThemeData
pub fn track_color( self, track_color: WidgetStatePropertyRef<Option<Color>>, ) -> SwitchThemeData
Dart SwitchThemeData(trackColor:).
Sourcepub fn track_outline_color(
self,
track_outline_color: WidgetStatePropertyRef<Option<Color>>,
) -> SwitchThemeData
pub fn track_outline_color( self, track_outline_color: WidgetStatePropertyRef<Option<Color>>, ) -> SwitchThemeData
Dart SwitchThemeData(trackOutlineColor:).
Sourcepub fn track_outline_width(
self,
track_outline_width: WidgetStatePropertyRef<Option<f64>>,
) -> SwitchThemeData
pub fn track_outline_width( self, track_outline_width: WidgetStatePropertyRef<Option<f64>>, ) -> SwitchThemeData
Dart SwitchThemeData(trackOutlineWidth:).
Sourcepub fn material_tap_target_size(
self,
material_tap_target_size: MaterialTapTargetSize,
) -> SwitchThemeData
pub fn material_tap_target_size( self, material_tap_target_size: MaterialTapTargetSize, ) -> SwitchThemeData
Dart SwitchThemeData(materialTapTargetSize:).
Sourcepub fn mouse_cursor(
self,
mouse_cursor: WidgetStatePropertyRef<Option<MouseCursorRef>>,
) -> SwitchThemeData
pub fn mouse_cursor( self, mouse_cursor: WidgetStatePropertyRef<Option<MouseCursorRef>>, ) -> SwitchThemeData
Dart SwitchThemeData(mouseCursor:).
Sourcepub fn overlay_color(
self,
overlay_color: WidgetStatePropertyRef<Option<Color>>,
) -> SwitchThemeData
pub fn overlay_color( self, overlay_color: WidgetStatePropertyRef<Option<Color>>, ) -> SwitchThemeData
Dart SwitchThemeData(overlayColor:).
Sourcepub fn splash_radius(self, splash_radius: f64) -> SwitchThemeData
pub fn splash_radius(self, splash_radius: f64) -> SwitchThemeData
Dart SwitchThemeData(splashRadius:).
Sourcepub fn thumb_icon(
self,
thumb_icon: WidgetStatePropertyRef<Option<Rc<Icon>>>,
) -> SwitchThemeData
pub fn thumb_icon( self, thumb_icon: WidgetStatePropertyRef<Option<Rc<Icon>>>, ) -> SwitchThemeData
Dart SwitchThemeData(thumbIcon:).
Sourcepub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> SwitchThemeData
pub fn padding(self, padding: impl Into<EdgeInsetsGeometry>) -> SwitchThemeData
Dart SwitchThemeData(padding:).
Sourcepub fn copy_with(&self) -> SwitchThemeData
pub fn copy_with(&self) -> SwitchThemeData
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().splash_radius(1.0)).
Sourcepub fn lerp(
a: Option<&SwitchThemeData>,
b: Option<&SwitchThemeData>,
t: f64,
) -> SwitchThemeData
pub fn lerp( a: Option<&SwitchThemeData>, b: Option<&SwitchThemeData>, t: f64, ) -> SwitchThemeData
Linearly interpolate between two SwitchThemeDatas.
{@macro dart.ui.shadow.lerp}
Trait Implementations§
Source§impl Clone for SwitchThemeData
impl Clone for SwitchThemeData
Source§impl Debug for SwitchThemeData
impl Debug for SwitchThemeData
Source§impl Default for SwitchThemeData
impl Default for SwitchThemeData
Source§impl Diagnosticable for SwitchThemeData
impl Diagnosticable for SwitchThemeData
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:).Source§impl Display for SwitchThemeData
impl Display for SwitchThemeData
Source§impl PartialEq for SwitchThemeData
impl PartialEq for SwitchThemeData
Source§impl SwitchThemeDataGetters for SwitchThemeData
impl SwitchThemeDataGetters for SwitchThemeData
Source§fn switch_theme_data(&self) -> &SwitchThemeData
fn switch_theme_data(&self) -> &SwitchThemeData
super(...)
arguments a defaults struct keeps.Source§fn thumb_color(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<Color>>>
fn thumb_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>
thumb_color getter.Source§fn track_color(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<Color>>>
fn track_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>
track_color getter.Source§fn track_outline_color(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<Color>>>
fn track_outline_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>
track_outline_color getter.Source§fn track_outline_width(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<f64>>>
fn track_outline_width( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<f64>>>
track_outline_width getter.Source§fn material_tap_target_size(
&self,
app: &mut App,
) -> Option<MaterialTapTargetSize>
fn material_tap_target_size( &self, app: &mut App, ) -> Option<MaterialTapTargetSize>
material_tap_target_size getter.Source§fn mouse_cursor(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>
fn mouse_cursor( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<MouseCursorRef>>>
mouse_cursor getter.Source§fn overlay_color(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<Color>>>
fn overlay_color( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Color>>>
overlay_color getter.Source§fn thumb_icon(
&self,
app: &mut App,
) -> Option<WidgetStatePropertyRef<Option<Rc<Icon>>>>
fn thumb_icon( &self, app: &mut App, ) -> Option<WidgetStatePropertyRef<Option<Rc<Icon>>>>
thumb_icon getter.Source§fn copy_with(&self, app: &mut App) -> SwitchThemeData
fn copy_with(&self, app: &mut App) -> SwitchThemeData
copyWith() with no arguments: a plain value holding what every getter
answers, for the caller’s setters to change.