Closed FisherWL closed 2 years ago
Hi @FisherWL 👋 Thanks for opening an issue!
I recommend going for a reactive repository approach in which you expose streams of data from the repository and you can manage multiple subscriptions in the bloc for each stock. This way stock updates can occur independently and in real-time and the bloc will handle updating the corresponding state property when a specific stock subscription emits new data.
Closing for now but if you still have questions the bloc discord is a great place to have these types of discussions with the community 👍
Question
in a stock app, on the watchlist page, there's a vertical list of users' favorite stocks, user could add/remove stock(s) into/from the list, each item is showing the historic trends of the stock, as the screenshot below:
the app's data layer is architectured as: stock trends data provider -> stock trends repository
how to design the bloc layer so that the app can make multiple/parallel requests from the data layer?
Desired Solution
parallel requests with bloc pattern
Alternatives Considered
I'm currently using
FutureBuilder
insiderStatefulWidget
to make the calls.