The purpose of the go_router for Flutter is to use declarative routes to reduce complexity, regardless of the platform you're targeting (mobile, web, desktop), handling deep linking from Android, iOS and the web while still allowing an easy-to-use developer experience.
While working on my app that uses BLoC and GoRouter I came across a problem that basically whenever I push (not go) a new route, the context is being dropped. It might not seem problematic at first, but in case I want to keep my BLoC's already declared on the second route and just build from them, I have to work around it.
Don't know if I'm missing something here, or maybe it's a chosen feature, but I would really appreciate if the context could be maintained at least between the parent route and it's children. Code example of my workaround:
While working on my app that uses BLoC and GoRouter I came across a problem that basically whenever I push (not go) a new route, the context is being dropped. It might not seem problematic at first, but in case I want to keep my BLoC's already declared on the second route and just build from them, I have to work around it. Don't know if I'm missing something here, or maybe it's a chosen feature, but I would really appreciate if the context could be maintained at least between the parent route and it's children. Code example of my workaround:
And then in the router builder (it's a child of /device):