flutter-clean-architecture-sample icon indicating copy to clipboard operation
flutter-clean-architecture-sample copied to clipboard

bloc in presenter is not clean

Open lxknvlk opened this issue 3 years ago • 1 comments

bloc is business logic component presenter is not for logic, it is for views logic should be in domain

lxknvlk avatar Nov 17 '21 13:11 lxknvlk

@lxknvlk BLoC should remains in presentation layer.

Please see : https://medium.com/ideas-by-idean/a-flutter-bloc-clean-architecture-journey-to-release-the-1st-idean-flutter-app-db218021a804

"BLoC can be seen as — yet another presenter disguised in ViewModel —inserted inside your widget tree through a BlocProvider, and helping you respond to events by returning states that can be used to build the corresponding UI (with a BlocBuilder) or perform corresponding actions (with a BlocListener)."

Just ask yourself, how can I reuse BLoC in a completely different application with the same domain? You can't - it's specific to your views.

sbatezat avatar Mar 21 '22 13:03 sbatezat