I have a nested structure, something like this:
List<Areas>
|-- List<Topics>
| |-- List<Exercises>
This is the workflow of my app:
- App is opened
- Fetch
APIand display a list ofAreas - The user chooses an
Areaand go to next screen - Fetch
APIand display a List of Topics - The user chooses a
Topicand go to next screen - Fetch
APIand display a List of Exercises - User needs to complete all of them
I started using BloC but I'm not sure if I should use a Bloc for each type of data (so one bloc for Areas, another for Topics and another for Exercises) or handle the whole structure in only one Bloc.
I see a problem having a State that contains the whole structure and needs to be updated every time a nested list is fetched from the API. Maybe this will cause memory problems?
On the other hand, having one Bloc per type of data will make complicated the communication between them.
I'm also opened to switch to another state management technique if it makes more sense.
Any help would be appreciated.
Thanks a lot.