MacosSwitch constructor

const MacosSwitch({
  1. Key? key,
  2. required bool value,
  3. ControlSize size = ControlSize.regular,
  4. required ValueChanged<bool>? onChanged,
  5. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  6. MacosColor? activeColor,
  7. MacosColor? trackColor,
  8. MacosColor? knobColor,
  9. 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,
});