onPopInvoked property
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;