Best way to architect a BLoC app in Flutter

Viewed 66

My app requires to consume different attributes of a User object in different sections of the app i.e. different screens and dialogs.

Example of User attributes would be a list of followers and following.

I need this User object to be reactive, i.e. should append a new user (response from api call) to it's following list when the subsequent action is performed.

Currently I plan to use certain BLoC's as Reactive View Models (from MVVM) for each screen (so that the business logic is separated from the presentation layer) and have a global User BLoC listening to these View Models.

For example :- User BLoC can listen to local View Model BLoC for follow user page and when the view model emits a successful state the response can be added to the User BLoC's User state's following list.

How feasible and performant would an implementation like this be? Is this the standard way of doing things in BLoC. I looked around for examples like these but could only find simple implementations of BLoC architecture. Would this be too over kill for a mid sized app?

Much appreciated!

0 Answers
Related