SwitchTheme class

Theme configuration for Switch widget styling and visual appearance.

Defines the visual properties used by switch components including colors, spacing, and border styling for different switch states. All properties are optional and fall back to framework defaults when not specified.

Supports comprehensive customization of switch appearance including track colors, thumb colors, and layout properties to match application design.

Constructors

SwitchTheme.new({Color? activeColor, Color? inactiveColor, Color? activeThumbColor, Color? inactiveThumbColor, double? gap, BorderRadiusGeometry? borderRadius})
Creates a SwitchTheme.
const

Properties

activeColor Color?
Color of the switch track when in the active/on state.
final
activeThumbColor Color?
Color of the switch thumb when in the active/on state.
final
borderRadius BorderRadiusGeometry?
Border radius applied to the switch track corners.
final
gap double?
Spacing between the switch and its leading/trailing widgets.
final
hashCode int
The hash code for this object.
no setteroverride
inactiveColor Color?
Color of the switch track when in the inactive/off state.
final
inactiveThumbColor Color?
Color of the switch thumb when in the inactive/off state.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({ValueGetter<Color?>? activeColor, ValueGetter<Color?>? inactiveColor, ValueGetter<Color?>? activeThumbColor, ValueGetter<Color?>? inactiveThumbColor, ValueGetter<double?>? gap, ValueGetter<BorderRadiusGeometry?>? borderRadius}) SwitchTheme
Returns a copy of this theme with the given fields replaced.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override