I have Bloc A
and Bloc B
and I need each of these blocs to have access to the List<String> Items
. This is easy to organize, it is enough to create a Repository class
, in which to place this List<String> Items
and pass it to each of the blocs when they are created. The problem is that when updating the data in the repository from bloc A, bloc B does not know that the repository data has changed. Perhaps I did not understand and read the documentation poorly, but I did not find an answer to my problem there. How can I subscribe to changes in data from several blocks at once?
There are several options, some are:
Official documentation describes bloc to bloc communication here, which this is.
https://bloclibrary.dev/#/architecture?id=bloc-to-bloc-communication