onChanged property
Called when the control changes value.
If the control is tapped, onChanged is called immediately with the new value. If the control changes value due to an animation (see positionController), the callback is called when the animation completes.
The control is considered interactive (see isInteractive) if this callback is non-null. If the callback is null, then the control is disabled, and non-interactive. A disabled checkbox, for example, is displayed using a grey color and its value cannot be changed.
Implementation
ValueChanged<bool> get onChanged => _onChanged;
Implementation
set onChanged(ValueChanged<bool> value) {
if (value == _onChanged)
return;
final bool wasInteractive = isInteractive;
_onChanged = value;
if (wasInteractive != isInteractive) {
markNeedsPaint();
markNeedsSemanticsUpdate();
}
}