CupertinoSwitchData constructor

const CupertinoSwitchData({
  1. bool? value,
  2. ValueChanged<bool>? onChanged,
  3. Key? widgetKey,
  4. bool isEnabled = true,
  5. Color? activeThumbColor,
  6. Color? activeTrackColor,
  7. Color? inactiveThumbColor,
  8. Color? inactiveTrackColor,
  9. Color? focusColor,
  10. ImageProvider<Object>? activeThumbImage,
  11. ImageErrorListener? onActiveThumbImageError,
  12. ImageProvider<Object>? inactiveThumbImage,
  13. ImageErrorListener? onInactiveThumbImageError,
  14. WidgetStateProperty<Color?>? trackOutlineColor,
  15. WidgetStateProperty<double?>? trackOutlineWidth,
  16. WidgetStateProperty<Icon?>? thumbIcon,
  17. DragStartBehavior dragStartBehavior = kDefaultDragStartBehavior,
  18. WidgetStateProperty<MouseCursor>? mouseCursor,
  19. FocusNode? focusNode,
  20. ValueChanged<bool>? onFocusChange,
  21. bool autofocus = kDefaultAutofocus,
  22. bool? applyTheme,
  23. Color? onLabelColor,
  24. Color? offLabelColor,
})

isEnabled is a convenience property for setting onChanged == null automatically. activeThumbColor is synonymous with thumbColor property of CupertinoSwitch.

Implementation

const CupertinoSwitchData({
  super.value,
  super.onChanged,
  super.widgetKey,
  super.isEnabled,
  super.activeThumbColor,
  super.activeTrackColor,
  super.inactiveThumbColor,
  super.inactiveTrackColor,
  super.focusColor,
  super.activeThumbImage,
  super.onActiveThumbImageError,
  super.inactiveThumbImage,
  super.onInactiveThumbImageError,
  super.trackOutlineColor,
  super.trackOutlineWidth,
  super.thumbIcon,
  super.dragStartBehavior,
  super.mouseCursor,
  super.focusNode,
  super.onFocusChange,
  super.autofocus,
  this.applyTheme,
  this.onLabelColor,
  this.offLabelColor,
});