-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is there a way to check which one is the current route? #41
Comments
class MiddleWare {
static MiddleWare _instance;
factory MiddleWare() {
if (_instance == null) _instance = MiddleWare._();
return _instance;
}
MiddleWare._();
static Routing _routing;
static Routing get routing => _routing;
static observer(Routing rt) {
_routing = rt;
}
}
class Foo {
yourMethod() {
if(MiddleWare.routing.current == routeName){
//Made anything
}
}
} |
Awesome, thanks |
Couple things:
|
Currently Get.currentRoute does the job. |
Ah, my bad. I assumed the list on pub.dev README was exhaustive. Thanks for the framework, it's really impressive. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have a navigation bar when I call
Get.toNamed(routeName)
whenever I tap on a button.But I'd like to prevent that call when the currentRoute is the same as routeName.
Couldn't find a way to get the current route name except from within the middleware. Would be nice to get an accesor to the current route from Get directly, like
Get.currentRoute
or somethingThe text was updated successfully, but these errors were encountered: