-
-
Save Vanethos/4d14255cf65ada3792295b388fa0f05e 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 main_common() async { | |
//... | |
runZoned<Future<Null>>(() async { | |
runApp(CrashyApp()); | |
}, onError: (error, stackTrace) async { | |
// Since the state can be null, we use `?.` to verify if it is null. If it is null, we don't do anything, if it is NOT null, we call the `push` function on it | |
navigatorKey.currentState?.push( | |
MaterialPageRoute(builder: (_) => ErrorWidget(), | |
)); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment