The bloc is in charge of managing an objects list state
Object:
This bloc is linked to a stream to get an update of each object info (connected/disconnected)
On the Page side, I need to display the list objects with the different status
This page is updated when ObjectsSuccess is fired
How to maintain the status of all the objects ?
I need to return all the objects in the ObjectsSuccessState so I need to keep this list
in the state ? so I need to get previous state to know other objects states
in the bloc itself (and the list of all objects states) ?
Any advice ?
Good question! Ultimately, there should be lower level repository classes that actually house _all_ the data for your running application, which your blocs can then access and combine/massage as needed for a specific page. Consider this set of layers:
UI/pages
|
(renders via)
|
v
State object
|
(produced by)
|
v
Blocs
|
(get data from)
|
v
Low level repositories
|
(make network requests to)
|
v
Your servers
Hope that helps!
Hey @fvisticot 馃憢
Thanks for opening an issue!
As @craiglabenz mentioned, the bloc should rely on the repository layer to retrieve the Stream of information. If you are still unsure of how to proceed in this particular case, please share a link to a sample application with your current approach and I would be happy to take a look and give suggestions 馃憤
Most helpful comment
Good question! Ultimately, there should be lower level repository classes that actually house _all_ the data for your running application, which your blocs can then access and combine/massage as needed for a specific page. Consider this set of layers:
Hope that helps!