SBBSwitchStyle class
Defines the visual properties of SBBSwitch.
Use this class in combination with SBBSwitchThemeData to customize the appearance of switches throughout your app or for specific widget subtrees.
See also:
- SBBSwitch, the switch widget that uses this style.
- SBBSwitchThemeData, which applies this style theme-wide.
- WidgetStateProperty, for defining state-specific property values.
Constructors
-
SBBSwitchStyle({WidgetStateProperty<
Color?> ? trackColor, WidgetStateProperty<Color?> ? knobBackgroundColor, WidgetStateProperty<Color?> ? knobBorderColor, WidgetStateProperty<Color?> ? knobForegroundColor, EdgeInsetsGeometry? tapTargetPadding}) -
const
Properties
- hashCode → int
-
The hash code for this object.
no setteroverride
-
knobBackgroundColor
→ WidgetStateProperty<
Color?> ? -
The background color of the switch knob (thumb).
final
-
knobBorderColor
→ WidgetStateProperty<
Color?> ? -
The border color of the switch knob (thumb).
final
-
knobForegroundColor
→ WidgetStateProperty<
Color?> ? -
The color of the icon (tick mark) displayed on the switch knob.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- tapTargetPadding → EdgeInsetsGeometry?
-
The space between the switch's tap target and its visual appearance.
final
-
trackColor
→ WidgetStateProperty<
Color?> ? -
The color of the switch track (background).
final
Methods
-
copyWith(
{WidgetStateProperty< Color?> ? trackColor, WidgetStateProperty<Color?> ? knobBackgroundColor, WidgetStateProperty<Color?> ? knobBorderColor, WidgetStateProperty<Color?> ? knobForegroundColor, EdgeInsetsGeometry? tapTargetPadding}) → SBBSwitchStyle -
merge(
SBBSwitchStyle? other) → SBBSwitchStyle -
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
Static Methods
-
lerp(
SBBSwitchStyle? a, SBBSwitchStyle? b, double t) → SBBSwitchStyle?
Constants
- knobBorderWidth → const double
-
knobBoxShadows
→ const List<
BoxShadow> - The box shadows applied to the switch knob.
- knobPressedExtension → const double
- The horizontal extension of the knob when pressed.
- knobRadius → const double
- The knob is drawn as a rounded rectangle with this radius for the corners.
- switchSize → const Size
- The total size of the switch (including knob extension).
- trackHeight → const double
- The height of the switch track.
- trackInnerEnd → const double
- The ending x-coordinate of the knob's travel range within the track.
- trackInnerLength → const double
- The horizontal distance the knob travels across the track.
- trackInnerStart → const double
- The starting x-coordinate of the knob's travel range within the track.
- trackSize → const Size
- The size of the switch track as a Size object.
- trackWidth → const double
- The width of the switch track.