onPopInvokedWithResult property
final
Called after a route pop was handled.
Even when the pop is canceled, for example by a PopScope widget, this
will still be called. The didPop
parameter indicates whether or not the
back navigation actually happened successfully.
This sample demonstrates how to use this parameter to show a confirmation
dialog when a navigation pop would cause form data to be lost.
link
To create a local project with this code sample, run:
flutter create --sample=widgets.Form.onPopInvokedWithResult.1 mysample
See also:
- canPop, which also comes from PopScope and is often used in conjunction with this parameter.
- PopScope.onPopInvokedWithResult, which is what Form delegates to internally.
Implementation
final PopInvokedWithResultCallback<Object?>? onPopInvokedWithResult;