SliderSwitch class

An small and fully customizable toggleable slider switch for flutter. It supports custom color, icon for the on and off states

Inheritance

Constructors

SliderSwitch({Key? key, bool initialStatus = false, ValueChanged<bool>? onChanged, Axis orientation = Axis.vertical, bool withSpring = true, double width = 50.0, double lenght = 130.0, Color statusOnColor = Colors.green, Color statusOffColor = Colors.grey, IconData statusOnIcon = Icons.volume_up, IconData statusOffIcon = Icons.volume_off, Offset statusOnIconOffset = const Offset(0.0, 0.0), Offset statusOffIconOffset = const Offset(0.0, 0.0), double statusColorOpacity = 0.5, bool isEnabled = true})

Properties

hashCode int
The hash code for this object.
no setterinherited
initialStatus bool
initial status for the switch. Default value: false
final
isEnabled bool
Is enabled the button. Default value: true
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
lenght double
Lenght in horizontal orientation or height in vertical orientation. Default value: 130.0
final
onChanged ValueChanged<bool>?
Callback function called when the switch change state.
final
orientation Axis
The orientation of the slider switch its horizontal or vertical. Default value: Axis.vertical
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statusColorOpacity double
Value of opacity for the background color. Default value: 0.5
final
statusOffColor Color
Color used as background when the switch is in "Off" state. Default value: Colors.grey
final
statusOffIcon IconData
Icon used when the switch is in "Off" state. Default value: Icons.volume_off
final
statusOffIconOffset Offset
statusOffIconOffset used to fine position the status icon Default value: Offset(0.0,0.0) dx: positive values ofset the position to the right dy: positive values offset the position up
final
statusOnColor Color
Color used as background when the switch is in "On" state. Default value: Colors.green
final
statusOnIcon IconData
Icon used when the switch is in "On" state. Default value: Icons.volume_up
final
statusOnIconOffset Offset
statusOnIconOffset used to fine position the status icon Default value: Offset(0.0,0.0) dx: positive values ofset the position to the right dy: positive values offset the position up
final
width double
Width in vertical orientation or height in horizontal orientation of the switch. Default value: 50.0
final
withSpring bool
Adds a spring animation when the user let go the button switch. Default value: true
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _SliderSwitchState
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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