Switch class

Undocumented public member.

Inheritance
Implemented types

Constructors

Switch({Key? key, required bool value, required String label, required void onChanged(bool newValue), bool focused = false, Style style = Style.empty, Style focusedStyle = const Style(modifiers: Modifier.reverse)})
Creates a new Switch.

Properties

focused bool
Whether this switch has keyboard focus.
final
focusedStyle Style
The rendering style applied when the switch is focused.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
The optional key for this widget.
finalinherited
label String
The text label accompanying the switch.
final
onChanged → void Function(bool newValue)
The callback triggered when the state changes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style Style
The normal rendering style.
final
value bool
The switch toggle state (on/off).
final

Methods

createElement() Element
Creates an Element to manage this widget's location in the tree.
inherited
createState() State<Switch>
Creates the mutable state for this widget at a given location in the tree.
override
getIntrinsicHeight(int width) int
Computes the intrinsic height of this widget under the given width constraint.
inherited
getIntrinsicWidth(int height) int
Computes the intrinsic width of this widget under the given height constraint.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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