This repository was archived by the owner on Feb 25, 2022. It is now read-only.
Persistent context between routes #380
Unanswered
JakubWasilczyk
asked this question in
Q&A
Replies: 2 comments
-
|
I don't know enough about bloc to help here but perhaps @jopmiddelkamp does. |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
It's not about the BLoC itself but just if the BuildContext in the builder would be the same context that I call the "push" with, the problem would be solved. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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):
Beta Was this translation helpful? Give feedback.
All reactions