Skip to content

Commit

Permalink
Adding 'await' - fixes the release version
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Rushour0 committed Mar 12, 2023
1 parent 9950443 commit 5fc16f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
Expand Down

0 comments on commit 5fc16f8

Please sign in to comment.