Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Flutter BLoC architecture List and Detail screens

Architecture question on Bloc and Flutter.
I have a List Screen with a Listview populated with StreamBuilder.
On Item tap, it opens a Detail Screen where the user can edit the values of that item.
That change has to be propagated to the List Screen Bloc, so that when Detail Screen is dismissed, the change is already reflected on the list.

I was thinking on sharing the same Bloc but thought there might be a better way.

Any ideas? Thanks.

like image 444
Alqueraf Avatar asked Oct 26 '25 00:10

Alqueraf


1 Answers

I had a similar problem when I was working on my blog post regarding BLoC. I found out that the best solution is to have one BLoC attached to one screen. These BLoCs can communicate with each other, and get each other states. You can follow my article if you are still interested in this topic.

like image 180
Kacper Kogut Avatar answered Oct 28 '25 17:10

Kacper Kogut



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!