LoadSwitch class
Constructors
-
LoadSwitch({required bool value, required Future<bool> future(), required dynamic onChange(bool), required dynamic onTap(bool), SpinStyle style = SpinStyle.material, dynamic onError(Object)?, double width = 95, double height = 50, Color spinColor(bool value)?, double spinStrokeWidth = 2, double thumbSizeRatio = 1, Duration? animationDuration, Decoration thumbDecoration(bool value, bool isActive)?, Decoration switchDecoration(bool value, bool isActive)?, Curve? curveIn, Curve? curveOut, bool? isLoading, bool isActive = true, Key? key})
-
const
Properties
-
animationDuration
→ Duration?
-
The duration of the switch animation. Defaults to 250ms.
final
-
curveIn
→ Curve?
-
The curve of the switch animation when going in loading state.
final
-
curveOut
→ Curve?
-
The curve of the switch animation when going out loading state.
final
-
future
→ Future<bool> Function()
-
The main Future with bool return type, which triggers when tapping the switch.
final
-
hashCode
→ int
-
The hash code for this object.
no setterinherited
-
height
→ double
-
The height of the switch. Must be less or equal to width. Defaults to 50.
final
-
isActive
→ bool
-
Whether the toggle is active or not. If null, the switch will be active.
final
-
isLoading
→ bool?
-
Manually change the loading state of the switch.
final
-
key
→ Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
onChange
→ dynamic Function(bool)
-
The callback when future has finished loading. Returns the response bool of the future.
final
-
onError
→ (dynamic Function(Object)?)
-
The callback when an error occurs during the future execution.
final
-
onTap
→ dynamic Function(bool)
-
Tap callback which returns the current value of the switch.
final
-
runtimeType
→ Type
-
A representation of the runtime type of the object.
no setterinherited
-
spinColor
→ (Color Function(bool value)?)
-
The color of the loading spinner.
final
-
spinStrokeWidth
→ double
-
The width of the loading spinner. Defaults to 2.
final
-
style
→ SpinStyle
-
The style of the loading spinner. Defaults to SpinStyle.material.
final
-
switchDecoration
→ (Decoration Function(bool value, bool isActive)?)
-
The decoration of the thumb.
final
-
thumbDecoration
→ (Decoration Function(bool value, bool isActive)?)
-
The decoration of the thumb.
final
-
thumbSizeRatio
→ double
-
The ratio of the thumb size to the switch size. Defaults to 1.
final
-
value
→ bool
-
Current value of the switch.
final
-
width
→ double
-
The width of the switch. Must be greater or equal to height. Defaults to 95.
final