From 5fc16f88c2db215fefef9bdf82f44b001fe2c548 Mon Sep 17 00:00:00 2001 From: Rushikesh Patade Date: Sun, 12 Mar 2023 22:48:25 +0530 Subject: [PATCH] Adding 'await' - fixes the release version The release version of the app was crashing on startup. This was because the environment variables were not being set before the app was started. This was because the code was not waiting for the environment variables to be set before trying to connect to the GraphQL client. --- lib/main.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 649e9e1e..0556b9be 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -10,8 +10,8 @@ import 'package:overlay_support/overlay_support.dart'; void main() async { WidgetsFlutterBinding.ensureInitialized(); - EnvironmentConfig.loadEnvVariables(); - SystemChrome.setPreferredOrientations([ + await EnvironmentConfig.loadEnvVariables(); + await SystemChrome.setPreferredOrientations([ DeviceOrientation.portraitUp, DeviceOrientation.portraitDown, ]);