CupertinoSwitch constructor Null safety
- {Key? key,
- required bool value,
- required ValueChanged<
bool> ? onChanged, - Color? activeColor,
- Color? trackColor,
- Color? thumbColor,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start}
Creates an iOS-style switch.
The value
parameter must not be null.
The dragStartBehavior parameter defaults to DragStartBehavior.start and must not be null.
Implementation
const CupertinoSwitch({
super.key,
required this.value,
required this.onChanged,
this.activeColor,
this.trackColor,
this.thumbColor,
this.dragStartBehavior = DragStartBehavior.start,
}) : assert(value != null),
assert(dragStartBehavior != null);