How to access the flutter ModalRoute<T>? #1927
Replies: 2 comments 4 replies
-
Hey @Adam-Langley unless the route you're working with is a tab-page you should be able to access it the same? |
Beta Was this translation helpful? Give feedback.
-
Hey @Milad-Akarie - thanks for responding. Usually, I am just pushing auto routes...
However, the "MyAutoRoute" is an instance of PageRouteInfo, not a ModalRoute... I dont see how to get access to the internal native class that would normally expose the 'changedExternalState' function. I have some dialogs that dont fit the auto_route way of doing things, so I wrap them in a ModalRoute - and that does expose the How do I do it with auto_route? I realise I could inject some argument exposing some kind of function pointer I can use to trigger setState... however I'd rather use what's already in the framework... |
Beta Was this translation helpful? Give feedback.
-
I have an application consisting of nested routers, and when state changes in my root route, I need to force an update in a child route.
Usually (when not using auto_route) I would access the ModalRoute, and call
changedExternalState
- triggering a rebuild.How can I access the native ModalRoute object constructed within auto_route, so that I can call this method?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions