maybePop<T extends Object> method

  1. @optionalTypeArgs
Future<bool> maybePop <T extends Object>(BuildContext context, [ T result ])

Returns the value of the current route's Route.willPop method for the navigator that most tightly encloses the given context.

See also:

  • Form, which provides an onWillPop callback that enables the form to veto a pop initiated by the app's back button.
  • ModalRoute, which provides a scopedWillPopCallback that can be used to define the route's willPop method.

Implementation

@optionalTypeArgs
static Future<bool> maybePop<T extends Object>(BuildContext context, [ T result ]) {
  return Navigator.of(context).maybePop<T>(result);
}