SwitchListTile.adaptive constructor

const SwitchListTile.adaptive(
  1. {Key key,
  2. @required bool value,
  3. @required ValueChanged<bool> onChanged,
  4. Color activeColor,
  5. Color activeTrackColor,
  6. Color inactiveThumbColor,
  7. Color inactiveTrackColor,
  8. ImageProvider activeThumbImage,
  9. ImageProvider inactiveThumbImage,
  10. Widget title,
  11. Widget subtitle,
  12. bool isThreeLine: false,
  13. bool dense,
  14. EdgeInsetsGeometry contentPadding,
  15. Widget secondary,
  16. bool selected: false,
  17. bool autofocus: false,
  18. ListTileControlAffinity controlAffinity: ListTileControlAffinity.platform}
)

Creates the wrapped switch with Switch.adaptive.

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.

Implementation

const SwitchListTile.adaptive({
  Key key,
  @required this.value,
  @required this.onChanged,
  this.activeColor,
  this.activeTrackColor,
  this.inactiveThumbColor,
  this.inactiveTrackColor,
  this.activeThumbImage,
  this.inactiveThumbImage,
  this.title,
  this.subtitle,
  this.isThreeLine = false,
  this.dense,
  this.contentPadding,
  this.secondary,
  this.selected = false,
  this.autofocus = false,
  this.controlAffinity = ListTileControlAffinity.platform,
}) : _switchListTileType = _SwitchListTileType.adaptive,
     assert(value != null),
     assert(isThreeLine != null),
     assert(!isThreeLine || subtitle != null),
     assert(selected != null),
     assert(autofocus != null),
     super(key: key);