SwitchProperties class
Holds configurable properties of the switch.
- Inheritance
-
- Object
- CustomProperties
- SwitchProperties
- Annotations
-
- @JsonSerializable()
Constructors
- SwitchProperties.new({ColorRGBA activeTrackColor = ColorRGBA.black, ColorRGBA inactiveTrackColor = ColorRGBA.grey, ColorRGBA activeThumbColor = ColorRGBA.white, ColorRGBA inactiveThumbColor = ColorRGBA.white, ColorRGBA hoverColor = ColorRGBA.grey10, ColorRGBA focusColor = ColorRGBA.grey10, double splashRadius = kRadialReactionRadius, bool autofocus = false, ColorRGBA? activeTrackBorderColor = ColorRGBA.transparent, ColorRGBA? inactiveTrackBorderColor = ColorRGBA.transparent, double trackOutlineWidth = 2, bool useMaterial3 = false})
- Creates a SwitchProperties instance with the given data.
- SwitchProperties.fromJson(Map json)
-
Creates a SwitchProperties instance from a JSON object.
factory
Properties
- activeThumbColor ↔ ColorRGBA
-
Color of switch's thumb when it's active.
getter/setter pair
- activeTrackBorderColor ↔ ColorRGBA?
-
Color of switch's track border when it's active.
getter/setter pair
- activeTrackColor ↔ ColorRGBA
-
Color of switch's track when it's active.
getter/setter pair
- autofocus ↔ bool
-
Whether to focus on the switch automatically.
getter/setter pair
- focusColor ↔ ColorRGBA
-
Color of switch when it is focused.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hoverColor ↔ ColorRGBA
-
Color of switch when it is hovered.
getter/setter pair
- inactiveThumbColor ↔ ColorRGBA
-
Color of switch's thumb when it's inactive.
getter/setter pair
- inactiveTrackBorderColor ↔ ColorRGBA?
-
Color of switch's track border when it's inactive.
getter/setter pair
- inactiveTrackColor ↔ ColorRGBA
-
Color of switch's track when it's inactive.
getter/setter pair
-
props
→ List<
Object?> -
The list of properties that will be used to determine whether
two instances are equal.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- splashRadius ↔ double
-
Splash radius of the circular ink response.
getter/setter pair
- stringify → bool?
-
If set to
true
, the toString method will be overridden to output this instance's props.no setterinherited - trackOutlineWidth ↔ double
-
Width of switch's track border.
getter/setter pair
- useMaterial3 ↔ bool
-
Whether to use material 3 style.
getter/setter pair
Methods
-
copyWith(
{ColorRGBA? activeTrackColor, ColorRGBA? inactiveTrackColor, ColorRGBA? activeThumbColor, ColorRGBA? inactiveThumbColor, ColorRGBA? hoverColor, ColorRGBA? focusColor, double? splashRadius, bool? autofocus, ColorRGBA? activeTrackBorderColor, ColorRGBA? inactiveTrackBorderColor, bool forceActiveTrackBorderColor = false, bool forceInactiveTrackBorderColor = false, double? trackOutlineWidth, bool? useMaterial3}) → SwitchProperties - Duplicates this SwitchProperties instance with the given data overrides.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> -
Serializes the properties to a JSON object.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited