Milad-Akarie / auto_route_library

Flutter route generator
MIT License
1.6k stars 405 forks source link

`AutoRoute.of` doesn't find nested declarative routers #2087

Open hmendez-figure opened 2 weeks ago

hmendez-figure commented 2 weeks ago

I expected AutoRouter.of to find my nested declarative router but doesn't. I think its because AutoRouter.of is actually calling and looking for StackRouterScope while declarative routers are scoped with HeroControlledScope.

Both scopes have NestedStackRouters so my expectation was, since AutoRouter.of returns StackRouter, that it would find the declarative router as well.

My current workaround is to call RouteScope.of and check/cast controller type.