CupertinoSwitch constructor

const CupertinoSwitch(
  1. {Key key,
  2. @required bool value,
  3. @required ValueChanged<bool> onChanged,
  4. Color activeColor,
  5. Color trackColor,
  6. 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.


const CupertinoSwitch({
  Key key,
  @required this.value,
  @required this.onChanged,
  this.dragStartBehavior = DragStartBehavior.start,
}) : assert(value != null),
     assert(dragStartBehavior != null),
     super(key: key);