TxCheckbox constructor
const
TxCheckbox({
- required bool? value,
- required ValueChanged<
bool?> ? onChanged, - Key? key,
- bool tristate = false,
- MouseCursor? mouseCursor,
- Color? activeColor,
- MaterialStateProperty<
Color?> ? fillColor, - Color? checkColor,
- Color? focusColor,
- Color? hoverColor,
- MaterialStateProperty<
Color?> ? overlayColor, - double? splashRadius,
- MaterialTapTargetSize? materialTapTargetSize,
- VisualDensity? visualDensity,
- FocusNode? focusNode,
- bool autofocus = false,
- OutlinedBorder? shape,
- BorderSide? side,
- bool isError = false,
- String? semanticLabel,
Creates a Material Design 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.
The following arguments are required:
value, which determines whether the checkbox is checked. Thevaluecan only be null iftristateis true.onChanged, which is called when the value of the checkbox should change. It can be set to null to disable the checkbox.
Implementation
const TxCheckbox({
required this.value,
required this.onChanged,
super.key,
this.tristate = false,
this.mouseCursor,
this.activeColor,
this.fillColor,
this.checkColor,
this.focusColor,
this.hoverColor,
this.overlayColor,
this.splashRadius,
this.materialTapTargetSize,
this.visualDensity,
this.focusNode,
this.autofocus = false,
this.shape,
this.side,
this.isError = false,
this.semanticLabel,
}) : _checkboxType = _TxCheckboxType.material,
assert(tristate || value != null);