onPopInvoked property

PopInvokedCallback? onPopInvoked

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.

To create a local project with this code sample, run:
flutter create --sample=widgets.Form.onPopInvoked.1 mysample

See also:


final PopInvokedCallback? onPopInvoked;