felangel / bloc

A predictable state management library that helps implement the BLoC design pattern
https://bloclibrary.dev
MIT License
11.79k stars 3.39k forks source link

Any good guide about how to design bloc and repository? #681

Closed wyxcoder closed 4 years ago

wyxcoder commented 4 years ago

It seems the Repository is mixed with Bloc, I wonder what is right way to lay them out in a project.

felangel commented 4 years ago

Hi @wyxcoder 👋 Thanks for opening an issue!

Can you provide more context? A bloc should depend on one or more repositories in order to fetch the required data to trigger a state change. You can refer to the bloc architecture documentation for more details. Hope that helps 👍

felangel commented 4 years ago

Closing for now but feel free to comment with additional questions/information and I'm happy to continue the conversation 👍