hungps / flutter_pokedex

Pokedex app built with Flutter (with lots of animations) using Clean Architecture
https://hungps.com
Other
2.31k stars 562 forks source link

Usecases is not used? #69

Closed lienminhquang closed 1 year ago

lienminhquang commented 1 year ago

I saw that you are using repositories in the bloc instead of usecases. (The usecases are not used anywhere in this project). Can someone explain to me why?

hungps commented 1 year ago

Hi @lienminhquang, In this repository, I use BloC's actions/events as a replacement for the usecases layer because, in my opinion, they share the same role. If I use the normal setState instead of BloC, I will definitely add the usecases layer to my structure. And of course, you can still add the usecases layer between BloC and repositories to share the usecases throughout your BloCs if that is what your project required

lienminhquang commented 1 year ago

Thank you @hungps. In my projects, the role of BloC and Usecase is also the same.