onChanged property

dynamic Function(bool?) onChanged
final

Called when the value of the checkbox should change. The checkbox passes the new value to the callback.

The callback provided to onChanged should update the state of the parent StatefulWidget using the State.setState method, so that the parent gets rebuilt; for example:

_isCheckBoxEnabled = false;
YaruCheckboxRow(
  value: _isCheckBoxEnabled,
  onChanged: (bool? newValue) {
    setState(() {
      _isCheckBoxEnabled = newValue!;
    });
  },
)

Implementation

final Function(bool?) onChanged;