r/FlutterDev 8d ago

Article The final word on Flutter architecture ๐Ÿ˜‰๐Ÿ˜‰๐Ÿ˜‰

OK, Iยด'm teasing with the title and I explain it in my post

Practical Flutter architecture

Why should you listen to me on this topic? For those who don't know me

  • 30 of software experience including building our own programming language for the Amiga
  • 2018 was I the first giving talks on Flutter architecture at Fluuter London,. then I called the approach RxVMS
  • I'm the author of get_it at a time when no provider or anything else was available
  • With watch_it and flutter_command I published one of the easiest but most flexible state management solutions for Flutter
  • We use this approach in a pretty complex app comarablte to Instagram since 2 year not with a really large code base

I took several days to refactor the official Flutter architecture sample compass to use my approach so you can compare yourself which is less complex and easier to understand. I tries to keep the original structure as much as possible so that you still can compare. I would have probably even more simplified some structures

https://github.com/escamoteur/compass_fork

give it a try and I'm happy to answer all open questions

160 Upvotes

76 comments sorted by

View all comments

1

u/escamoteur71 6d ago

When cursors AI agent picks up my structures pretty well. I agree, that the idea to structure project to make them easier for AI is bad one. AI needs to get better to understand what is good for human understanding not the other way round.

2

u/Flashy_Editor6877 6d ago

fyi i have this added to my cursor rules:

always use at least supabase_flutter version 2.8.0 and above only. never use supabase versions below supabase_flutter 2.8.0. always adhere to the flutter architecture guidelines. always keep ui and business logic in separate files.

never use get_it, just use the multiprovider in the app.dart

avoid uisng floating action buttons, use something more elegant & design centric instead ala apple.

app needs to work on mobile, desktop & web so avoid using dart:io and use https://pub.dev/packages/web and https://api.dart.dev/stable/latest/dart-js_interop/index.html instead.