waitAndPush method

Future waitAndPush(
  1. Uri uri, {
  2. dynamic params,
})

Simple method to use instead of await Navigator.push(context, ...) The result can be set either by returnWith

Implementation

Future<dynamic> waitAndPush(Uri uri, {dynamic params}) async {
  _boolResultCompleter = Completer<dynamic>();
  await push(uri, params: params);
  notifyListeners();
  return _boolResultCompleter!.future;
}