YaruCheckbox constructor

const YaruCheckbox({
  1. Key? key,
  2. required bool? value,
  3. bool tristate = false,
  4. required ValueChanged<bool?>? onChanged,
  5. Color? selectedColor,
  6. Color? checkmarkColor,
  7. FocusNode? focusNode,
  8. bool autofocus = false,
  9. MouseCursor? mouseCursor,
  10. MaterialStatesController? statesController,
})

A Yaru checkbox.

The checkbox 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 with a new value to update the visual appearance of the checkbox.

Implementation

const YaruCheckbox({
  super.key,
  required this.value,
  this.tristate = false,
  required this.onChanged,
  this.selectedColor,
  this.checkmarkColor,
  this.focusNode,
  this.autofocus = false,
  this.mouseCursor,
  this.statesController,
}) : assert(tristate || value != null);