onPopInvoked property

Future<bool> Function(Route)? onPopInvoked
final

Optional async callback invoked before popping, allowing confirmation dialogs (e.g., "Discard unsaved changes?"). Return true to allow the pop, false to prevent it.

Implementation

final Future<bool> Function(Route<dynamic>)? onPopInvoked;