Is there a way to manually check with go_router (latest version 7.1.1) if a certain path (aka "route") is currently active?
Example: There are 2 paths:
- "/projects/:id"
- "/projects/:id/details"
Now I want to check manually if the currently active path is 1) or 2).
Due to the dynamic parameters and the nesting it is not possible to simply compare the currently active path (goRouterState.location)
with the one to be checked, e.g. with contains()
or startsWith()
.
Checking against a regex would be extremely error-prone as well as cumbersome and unnecessary, since go_router can actually handle the matching.
I have not found any functionality of go_router for that.
Since I need this urgently, I am grateful for any tip!