WidgetSwitch2 class

Inheritance

Constructors

WidgetSwitch2({Key? key, Color colorLeftBackground = Colors.red, double disableOpacity = 0.6, Color colorRightBackground = Colors.green, Color colorButton = const Color(0xffF0F0F0), double width = 100, Color backgroundCenter = const Color(0xFFF0F0F0), required ValueChanged onChange, int duration = 200, double buttonSize = 25, bool enable = true, String textLeft = "Off", String textRight = "On", List values = const [0, 2, 1], dynamic initValue = 2})

Properties

backgroundCenter Color
Background center state
getter/setter pair
buttonSize double
button size
getter/setter pair
colorButton Color
color button
final
colorLeftBackground Color
colorLeftBackground state
getter/setter pair
colorRightBackground Color
background colorRight state
getter/setter pair
disableOpacity double
Set disable opacity
getter/setter pair
duration int
set duration transition between states
getter/setter pair
enable bool
switch enable
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
initValue ↔ dynamic
Init value/default
getter/setter pair
key Key?
Key
getter/setter pairoverride-getter
onChange ValueChanged
return the value on change tap
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
textLeft String
Left Text
getter/setter pair
textRight String
Right text
getter/setter pair
values List
List of values to 2 or 3 states
final
width double
width switch
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _WidgetSwitch2State
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