waitAndPush method
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;
}