Created
August 25, 2022 19:33
-
-
Save emiliodallatorre/e540497fdea39dea1b250e47d06756e2 to your computer and use it in GitHub Desktop.
Find current route without context
This file contains hidden or 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
// https://stackoverflow.com/questions/46483949/how-to-get-current-route-path-in-flutter | |
String? currentPath; | |
navigatorKey.currentState?.popUntil((Route<dynamic> route) { | |
currentPath = route.settings.name; | |
return true; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment