So I am preparing a plan for a new #Flutter project. Here is a list of some, in my opinion, must-have things that should be implemented or at least decided early on in any new project 🧵
1. Linter
That's one of the easiest things to implement and one of the most helpful ones to keep your code clean. In Dart/Flutter, choose any pre-defined set of rules (e.g. packages like Pedantic, Very Good Analysis or Lint) since you can always adjust them based on your needs.
2. Localization
Even though you are building a single-language app, I would still recommend you implementing localization (l10n) early on, thus separating your texts from UI code. The documentation explains this process really well: flutter.dev/docs/developme…
3. Environments/flavors (1/2)
It's a good practice to create different environments for your project e.g. development, staging/testing, production. This way, you could go bananas in your dev environment while the already released app and more important - your data - stays stable.
3. Environments/flavors (2/2)
Having an intermediate environment, like testing, helps you validating the changes and new features before releasing them to production. Custom API endpoints, icons, app name per environment - that's what flavors are about. flutter.dev/docs/deploymen…
4. CI/CD
After introducing different environments, a natural next step is to automate the process of building, testing and releasing your app. Lots of CI/CD platforms support Flutter, such as @appcircleio, @codemagicio, @bitrise, VS AppCenter - any of those will do the trick.
5. Back-end
Do you already have your own back-end? Great, skip this step! If not, take a look at cloud solutions supporting Flutter - @Firebase, @AWSAmplify, @supabase. These platforms provide authentication, database, storage, API options for your app. Or build a custom one 🤷♂️
6. Logging/Crash data
Everything is cool until something goes wrong - you need info about that! Services likes @getsentry, Firebase Crashlytics, @datadoghq could help you logging the most important data, crash reports or even set up notifications when your app/services are down.
7. Branding
If you already have UI designs of your app, it's a good practice to introduce fonts, colours, shapes and other details early on in your project. @RydMike created an awesome package for this: pub.dev/packages/flex_…
8. State management
Yes, the controversial one. At the beginning of the project, I would recommend deciding on the specific state management solution since it affects the whole architecture of the app. There are no good or bad ones, just choose what fits your project the best.
9. Code generation
If you want to cut some corners, you could use code generation in your project whether that's working with l10n, assets, parsing JSON, generating model classes or working with immutable state. For more info, here is my talk about it:
10. README file
You heard me right - documentation. Commands to generate/test/run your code, code structure decisions, external tools/services, info about environments (WITHOUT SECRET KEYS) - everything should be put in the most important document of the project, the README file.
Did I miss something? Mention that in the comments! What's your checklist while building a new #Flutter app? 💙
• • •
Missing some Tweet in this thread? You can try to
force a refresh