DrivenSwitchStyle class
Create a SwitchStyle that handle the widget events
- Inheritance
-
- Object
- SwitchStyle
- DrivenSwitchStyle
- Implemented types
Constructors
- DrivenSwitchStyle({Size? size, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, Color? trackBorderColor, double? trackBorderOpacity, int? trackBorderAlpha, double? trackBorderWidth, BorderRadiusGeometry? trackBorderRadius, Color? trackColor, double? trackOpacity, int? trackAlpha, double? trackHeight, ShapeBorder? thumbShape, Color? thumbColor, double? thumbOpacity, int? thumbAlpha, double? thumbInset, double? thumbSize, Color? thumbShadow, double? thumbElevation, Color? overlayColor, double? overlayOpacity, bool? overlayDisabled, double? overlayRadius, SwitchStyle? selectedStyle, SwitchStyle? indeterminateStyle, SwitchStyle? focusedStyle, SwitchStyle? hoveredStyle, SwitchStyle? pressedStyle, SwitchStyle? disabledStyle, bool? mergeResolved})
-
Create a raw of driven switch style
const
- DrivenSwitchStyle.from(SwitchStyle? enabledStyle, {SwitchStyle? selectedStyle, SwitchStyle? indeterminateStyle, SwitchStyle? focusedStyle, SwitchStyle? hoveredStyle, SwitchStyle? pressedStyle, SwitchStyle? disabledStyle, bool? mergeResolved})
- Create a DrivenSwitchStyle with value from another SwitchStyle.
-
DrivenSwitchStyle.resolver(DrivenPropertyResolver<
SwitchStyle?> resolver, {bool? mergeResolved = false}) - Create a DrivenSwitchStyle from a resolver callback
Properties
- disabledStyle → SwitchStyle?
-
The style to be resolved when
events includes SwitchEvent.disabled.
final
-
driven
→ Map<
WidgetEvent, SwitchStyle?> -
Map of driven style, order matters
no setter
- focusedStyle → SwitchStyle?
-
The style to be resolved when
events includes SwitchEvent.focused.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hoveredStyle → SwitchStyle?
-
The style to be resolved when
events includes SwitchEvent.hovered.
final
- indeterminateStyle → SwitchStyle?
-
The style to be resolved when
events includes SwitchEvent.indeterminate.
final
- margin → EdgeInsetsGeometry?
-
Empty space to surround the outside clickable area.
finalinherited
- mergeResolved → bool?
-
Whether the resolved style is merged to
the previous resolved style or not
final
- overlayColor → Color?
-
The overlay color when pressed, hovered over, or focused.
finalinherited
- overlayDisabled → bool?
-
Whether the overlay is disabled or not,
finalinherited
- overlayOpacity → double?
-
The overlay opacity when pressed, hovered over, or focused.
finalinherited
- overlayRadius → double?
-
The radius of the overlay.
finalinherited
- padding → EdgeInsetsGeometry?
-
Empty space to increase the clickable area.
finalinherited
- pressedStyle → SwitchStyle?
-
The style to be resolved when
events includes SwitchEvent.pressed.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedStyle → SwitchStyle?
-
The style to be resolved when
events includes SwitchEvent.selected.
final
- size → Size?
-
The size of the Switch.
finalinherited
- thumbAlpha → int?
-
finalinherited
- thumbColor → Color?
-
finalinherited
- thumbElevation → double?
-
finalinherited
- thumbInset → double?
-
finalinherited
- thumbOpacity → double?
-
finalinherited
- thumbShadow → Color?
-
finalinherited
- thumbShape → ShapeBorder?
-
finalinherited
- thumbSize → double?
-
finalinherited
- trackAlpha → int?
-
finalinherited
- trackBorderAlpha → int?
-
finalinherited
- trackBorderColor → Color?
-
finalinherited
- trackBorderOpacity → double?
-
finalinherited
- trackBorderRadius → BorderRadiusGeometry?
-
finalinherited
- trackBorderWidth → double?
-
finalinherited
- trackColor → Color?
-
finalinherited
- trackHeight → double?
-
finalinherited
- trackOpacity → double?
-
finalinherited
Methods
-
copyWith(
{Size? size, EdgeInsetsGeometry? margin, EdgeInsetsGeometry? padding, Color? trackBorderColor, double? trackBorderOpacity, int? trackBorderAlpha, double? trackBorderWidth, BorderRadiusGeometry? trackBorderRadius, Color? trackColor, double? trackOpacity, int? trackAlpha, double? trackHeight, ShapeBorder? thumbShape, Color? thumbColor, double? thumbOpacity, int? thumbAlpha, double? thumbInset, double? thumbSize, Color? thumbShadow, double? thumbElevation, Color? overlayColor, double? overlayOpacity, bool? overlayDisabled, double? overlayRadius, bool? mergeResolved, SwitchStyle? indeterminateStyle, SwitchStyle? selectedStyle, SwitchStyle? focusedStyle, SwitchStyle? hoveredStyle, SwitchStyle? pressedStyle, SwitchStyle? disabledStyle}) → DrivenSwitchStyle -
Creates a copy of this DrivenSwitchStyle but with
the given fields replaced with the new values.
override
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
merge(
SwitchStyle? other) → SwitchStyle -
Creates a copy of this SwitchStyle but with
the given fields replaced with the new values.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
resolve(
Set< WidgetEvent> events) → SwitchStyle -
Returns a value of type
T
that depends onevents
.override -
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toMap(
) → Map< String, dynamic> -
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringShort(
) → String -
A brief description of this object, usually just the runtimeType and the
hashCode.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
evaluate(
SwitchStyle? value, Set< WidgetEvent> events) → SwitchStyle? -
Resolves the value for the given set of events
if
value
is an event driven SwitchStyle, otherwise returns the value itself.override