onChanged property
Called when the user toggles the switch.
If null, the switch is disabled: it renders at 50% opacity, ignores touch and keyboard input without lifting into a glass lens, and is reported as disabled to assistive technology.
Implementation
final ValueChanged<bool>? onChanged;