WidgetSwitch2 class Null safety

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
read / write
buttonSize double
button size
read / write
colorButton Color
color button
final
colorLeftBackground Color
colorLeftBackground state
read / write
colorRightBackground Color
background colorRight state
read / write
disableOpacity double
Set disable opacity
read / write
duration int
set duration transition between states
read / write
enable bool
switch enable
read / write
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
initValue ↔ dynamic
Init value/default
read / write
key Key?
Key
read / write, override-getter
onChange ValueChanged
return the value on change tap
final
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
textLeft String
Left Text
read / write
textRight String
Right text
read / write
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. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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. [...]
@nonVirtual, inherited