MacosSwitch constructor
const
MacosSwitch({
- Key? key,
- required bool value,
- ControlSize size = ControlSize.regular,
- required ValueChanged<
bool> ? onChanged, - DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- MacosColor? activeColor,
- MacosColor? trackColor,
- MacosColor? knobColor,
- String? semanticLabel,
A switch is a control that offers a binary choice between two mutually exclusive states — on and off.
A switch shows that it's on when the activeColor is visible and off when the trackColor is visible.
Additional Reference:
Implementation
const MacosSwitch({
super.key,
required this.value,
this.size = ControlSize.regular,
required this.onChanged,
this.dragStartBehavior = DragStartBehavior.start,
this.activeColor,
this.trackColor,
this.knobColor,
this.semanticLabel,
});