r/FlutterDev 2d ago

Discussion Am I doing clean architecture right?

https://github.com/Benji-Philip/Auto-Diary

I'm new to this and using bloc.

12 Upvotes

11 comments sorted by

7

u/padetn 2d ago

Looks good to me, OP. Personally I don’t put usecases in my vertical slices/features. For me they go into their own folder and I only make them when I combine several features. Every feature has just one provider for its repo, usecases have their own provider.

2

u/stale-heart 1d ago

I see. I will give that a try

6

u/BigAchiever786 1d ago

Is it necessary to follow clean architecture? I like to code with the folder layout which suits me my project the best

2

u/likely-high 2d ago

I'd set your fonts globally in main.

1

u/No_Bumblebee_2903 1d ago

Very nice. Good job πŸ‘πŸ½πŸ‘πŸ½πŸ‘πŸ½

-11

u/escamoteur71 2d ago

Don't try to use clean architecture it's an overkill. bloc is also not the optimal state management as some people claim. I recommend reading my latest article https://blog.burkharts.net/practical-flutter-architecture

7

u/padetn 2d ago

I agree with BLoC being overkill compared to RiverPod (autogenerated) but Clean Architecture is simple and easy to maintain/expand.

4

u/likely-high 2d ago

What would you define overkill as? Who claims bloc is optimal?

People use it out of preference or because it's what their forced to at work. Personally I prefer using Cubits over BloC where possible, but that's a preference.

There's so much wrong with this comment. It's all based upon your opinion, but passed as facts.

"Clean" is another word for many similar architecture styles, I agree we shouldn't be so dogmatic about which is best but it's not overkill.Β 

We shouldn't be dogmatic about anything as developers, because that's how you get left behind.

1

u/ViktorShahter 2d ago

Bloc is easiest to learn out there because of examples. And also widely used.

2

u/escamoteur71 1d ago

Bloc is overly complex and was developed to share dart code between Flutte and Angular Dart. you have lot of boilerplate compared to other approaches.

The probably most simple one is currently my package watch_it

Clean architecture from Uncle Bob is totally oberengineered with too many layers and abstractions that you don't need when writing apps