onTap property

FutureOr<bool> Function(bool to) onTap
final

Called when the user toggles the switch on or off.

The switch passes the new value to the callback and

  • update state if it returns truthy.
  • do nothing if it returns falsy.

Implementation

final FutureOr<bool> Function(bool to) onTap;