Switch.adaptive constructor

const Switch.adaptive({Key key, @required bool value, @required ValueChanged<bool> onChanged, Color activeColor, Color activeTrackColor, Color inactiveThumbColor, Color inactiveTrackColor, ImageProvider activeThumbImage, ImageProvider inactiveThumbImage, MaterialTapTargetSize materialTapTargetSize })

Creates a CupertinoSwitch if the target platform is iOS, creates a material design switch otherwise.

If a CupertinoSwitch is created, the following parameters are ignored: activeTrackColor, inactiveThumbColor, inactiveTrackColor, activeThumbImage, inactiveThumbImage, materialTapTargetSize.

The target platform is based on the current Theme: ThemeData.platform.

Implementation

const Switch.adaptive({
  Key key,
  @required this.value,
  @required this.onChanged,
  this.activeColor,
  this.activeTrackColor,
  this.inactiveThumbColor,
  this.inactiveTrackColor,
  this.activeThumbImage,
  this.inactiveThumbImage,
  this.materialTapTargetSize,
}) : _switchType = _SwitchType.adaptive,
     super(key: key);