CupertinoSwitch constructor

const CupertinoSwitch({
  1. Key? key,
  2. required bool value,
  3. required ValueChanged<bool>? onChanged,
  4. Color? activeColor,
  5. Color? trackColor,
  6. Color? thumbColor,
  7. bool? applyTheme,
  8. Color? focusColor,
  9. Color? onLabelColor,
  10. Color? offLabelColor,
  11. FocusNode? focusNode,
  12. ValueChanged<bool>? onFocusChange,
  13. bool autofocus = false,
  14. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
})

Creates an iOS-style switch.

The dragStartBehavior parameter defaults to DragStartBehavior.start.

Implementation

const CupertinoSwitch({
  super.key,
  required this.value,
  required this.onChanged,
  this.activeColor,
  this.trackColor,
  this.thumbColor,
  this.applyTheme,
  this.focusColor,
  this.onLabelColor,
  this.offLabelColor,
  this.focusNode,
  this.onFocusChange,
  this.autofocus = false,
  this.dragStartBehavior = DragStartBehavior.start,
});