Closed fakalit closed 4 months ago
Seems like adding a "key" to the provider resolves the matter. Thanks.
Sorry this is late, just as a side note. BlocProvider
takes a dependencies array. You can pass a new bloc instance to the dependencies array which will provide a new bloc instance.
That helps a lot. Thanks for the clarification and the great work you've done on the library.
Description When a BlocProvider instance rerenders and changes the bloc instance it provides, a BlocBuilder under the component tree still continues to be subcribed to the initial bloc.
Steps To Reproduce
This is my attempt at isolating the issue to its basics.
When a different bloc is given the Box Component, it can be seen that it rerenders from the console log, but the bloc builder still continues log the initial bloc's id.
Expected Behavior I expected the BlocProviderd to switch to the new bloc instance provided by the BlocProvider.
I'm not sure what's happening now is the intended behaviour, but the above pattern was usable in the original package. I appreciate help and any pointers that can help with its resolution. Thanks like always.