From 59558fc1a4b0a1d65581055657c389f937225ad8 Mon Sep 17 00:00:00 2001 From: Bruno Mendes Date: Wed, 4 Oct 2023 18:52:30 +0100 Subject: [PATCH] Do not wait for trips before dismissing bus dialog --- .../view/bus_stop_selection/widgets/bus_stop_search.dart | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart b/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart index be55fc3b8..5155dde2d 100644 --- a/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart +++ b/uni/lib/view/bus_stop_selection/widgets/bus_stop_search.dart @@ -112,9 +112,11 @@ class BusStopSearch extends SearchDelegate { child: Text(S.of(context).confirm), onPressed: () async { if (stopData!.configuredBuses.isNotEmpty) { - await Provider.of(context, listen: false) - .addUserBusStop(stopCode!, stopData!); - if (context.mounted) Navigator.pop(context); + unawaited( + Provider.of(context, listen: false) + .addUserBusStop(stopCode!, stopData!), + ); + Navigator.pop(context); } }, )