From fa07cb1f017e153a15ddbc9a04840e7981e9e5e2 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Sun, 1 Sep 2024 13:36:27 +0300 Subject: [PATCH] Fix for warning on launch --- lib/main.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/main.dart b/lib/main.dart index 1c66ef0824..af4d9738e3 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -114,11 +114,12 @@ class MyHttpOverrides extends HttpOverrides { } void main({bool isTesting = false}) async { + WidgetsFlutterBinding.ensureInitialized(); + final prefs = await SharedPreferences.getInstance(); HttpOverrides.global = MyHttpOverrides(prefs.getString(kSharedPrefHostOverride) ?? ''); - WidgetsFlutterBinding.ensureInitialized(); _registerErrorHandlers(); final ConnectionStatusSingleton connectionStatus =