CheckboxListTile constructor

const CheckboxListTile({Key key, @required bool value, @required ValueChanged<bool> onChanged, Color activeColor, Widget title, Widget subtitle, bool isThreeLine: false, bool dense, Widget secondary, bool selected: false, ListTileControlAffinity controlAffinity: ListTileControlAffinity.platform })

Creates a combination of a list tile and a checkbox.

The checkbox tile itself does not maintain any state. Instead, when the state of the checkbox changes, the widget calls the onChanged callback. Most widgets that use a checkbox will listen for the onChanged callback and rebuild the checkbox tile with a new value to update the visual appearance of the checkbox.

The following arguments are required:

  • value, which determines whether the checkbox is checked, and must not be null.

  • onChanged, which is called when the value of the checkbox should change. It can be set to null to disable the checkbox.

Implementation

const CheckboxListTile({
  Key key,
  @required this.value,
  @required this.onChanged,
  this.activeColor,
  this.title,
  this.subtitle,
  this.isThreeLine = false,
  this.dense,
  this.secondary,
  this.selected = false,
  this.controlAffinity = ListTileControlAffinity.platform,
}) : assert(value != null),
     assert(isThreeLine != null),
     assert(!isThreeLine || subtitle != null),
     assert(selected != null),
     assert(controlAffinity != null),
     super(key: key);