-
-
Save Vanethos/7a517a5f3186889d77a4a69109fae79f 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
/// Navigator key to navigate without a BuildContext | |
final GlobalKey<NavigatorState> navigatorKey = GlobalKey<NavigatorState>(); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return new MaterialApp( | |
// Add the navigator key to our app | |
navigatorKey: navigatorKey, | |
//... | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment