Toggle
Last updated
Last updated
A toggle is used to quickly switch between two possible states. They are commonly used for “on/off” switches.
onToggle
Called when the value of the toggle change. This callback passes the new value, but doesn't update its state internally.
Type: void Function(bool value)
Default: required
enable
Whether the toggle is enabled or not.
Type: bool
Default: true
value
Whether the initial value of the toggle is checked or not.
Type: bool
Default: true
labelText
The labelText
of this toggle.
Type: String?
Default: optional
size
The size of this toggle. It can be md
or sm.
Type: CToggleSize
Default: CToggleSize.md
showStatusLabel
Whether the toggle should display its status (On
| Off
) or not.
Type: bool
Default: true