M3ESwitchTheme class

Theme values for M3ESwitch.

Inheritance
Annotations

Constructors

M3ESwitchTheme({double trackWidth = 52, double trackHeight = 32, double trackPadding = 4, double thumbSizePressed = 28, double thumbSizeSelected = 24, double thumbSizeUnselected = 16, double thumbSizeWithIcon = 24, double stateLayerSize = 40, double targetSize = 48, double iconSize = 16, double borderWidth = 2, double disabledTrackOpacity = 0.12, double disabledThumbOpacity = 0.38, double disabledSelectedHandleOpacity = 1, double disabledOutlineOpacity = 0.12, double hoverStateLayerOpacity = 0.08, double focusStateLayerOpacity = 0.1, double pressedStateLayerOpacity = 0.1, double focusIndicatorThickness = 3, double focusIndicatorOffset = 2, Color? focusIndicatorColor, M3ESpring positionSpring = const M3ESpring(stiffness: 380, damping: 0.55), M3ESpring sizeSpring = const M3ESpring(stiffness: 380, damping: 0.7)})
M3ESwitchTheme.
const

Properties

borderWidth → double
borderWidth.
final
disabledOutlineOpacity → double
disabledOutlineOpacity.
final
disabledSelectedHandleOpacity → double
Opacity for the disabled selected handle.
final
disabledThumbOpacity → double
Opacity for the disabled unselected handle and disabled icons.
final
disabledTrackOpacity → double
disabledTrackOpacity.
final
focusIndicatorColor → Color?
Focus-ring color. Null resolves to M3EColorScheme.secondary.
final
focusIndicatorOffset → double
Gap between the state layer and the focus ring.
final
focusIndicatorThickness → double
Keyboard focus-ring stroke width.
final
focusStateLayerOpacity → double
Focus state-layer opacity.
final
hashCode → int
The hash code for this object.
no setterinherited
hoverStateLayerOpacity → double
Hover state-layer opacity.
final
iconSize → double
iconSize.
final
positionSpring → M3ESpring
Thumb position spring (overshoot toward resting side).
final
pressedStateLayerOpacity → double
Pressed state-layer opacity.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sizeSpring → M3ESpring
Thumb size spring (follows the slide, more damped).
final
stateLayerSize → double
Diameter of the handle-centered hover/focus/press state layer.
final
targetSize → double
Minimum control slot. The track stays centered inside it.
final
thumbSizePressed → double
thumbSizePressed.
final
thumbSizeSelected → double
thumbSizeSelected.
final
thumbSizeUnselected → double
thumbSizeUnselected.
final
thumbSizeWithIcon → double
Handle size when the current state shows an icon.
final
trackHeight → double
trackHeight.
final
trackPadding → double
Inset that keeps the 24dp handle inside the track.
final
trackWidth → double
trackWidth.
final

Methods

copyWith({double? trackWidth, double? trackHeight, double? trackPadding, double? thumbSizePressed, double? thumbSizeSelected, double? thumbSizeUnselected, double? thumbSizeWithIcon, double? stateLayerSize, double? targetSize, double? iconSize, double? borderWidth, double? disabledTrackOpacity, double? disabledThumbOpacity, double? disabledSelectedHandleOpacity, double? disabledOutlineOpacity, double? hoverStateLayerOpacity, double? focusStateLayerOpacity, double? pressedStateLayerOpacity, double? focusIndicatorThickness, double? focusIndicatorOffset, Color? focusIndicatorColor, bool clearFocusIndicatorColor = false, M3ESpring? positionSpring, M3ESpring? sizeSpring}) → M3ESwitchTheme
Returns a copy with non-null fields replaced.
override
iconColor(M3EColorScheme scheme, {required bool value, bool enabled = true}) → Color
iconColor.
lerp(M3ESwitchTheme? other, double t) → M3ESwitchTheme
Linearly interpolates between this theme and other.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
outlineColor(M3EColorScheme scheme, {required bool enabled}) → Color
outlineColor.
resolveFocusIndicatorColor(M3EColorScheme scheme) → Color
Focus-ring color for scheme.
stateLayerColor(M3EColorScheme scheme, {required bool value}) → Color
stateLayerColor.
stateLayerOpacity(M3EInteractionState state) → double
Opacity for the active hover, focus, or pressed state layer.
thumbColor(M3EColorScheme scheme, {required bool enabled, required bool value, bool hovered = false, bool focused = false, bool pressed = false}) → Color
thumbColor.
thumbSize({required bool pressed, required bool grown, bool hasIcon = false}) → double
thumbSize.
toString() → String
A string representation of this object.
inherited
trackColor(M3EColorScheme scheme, {required bool enabled, required bool value}) → Color
trackColor.

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Constants

defaults → const M3ESwitchTheme
defaults.