-
-
Save Vanethos/25cda626fa829c925b1ea8d00d3fb4f3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void mainCommon(Config config) async { | |
// Create completerto receive the result | |
final completer = Completer<bool>(); | |
// Run first widget to fetch data from the network | |
runApp( | |
SplashPage(completer: completer,) | |
); | |
// This will wait for the SplashPage to finish the request. | |
// It will be `true` if we receive a result from the network and `false` otherwise | |
bool isLoggedIn = await completer.future; | |
// Runs the app with the Config and login status information | |
runApp( | |
MyApp(config, isLoggedIn) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment