Optimize Flutter Apps: Fast Flutter App Performance

Flutter is performant by default . Developers behind Flutter and Dart have spent an enormous amount of time to make their performance near-native . However, as we have recently developed & released the Rokomari app , Bangladesh’s largest online bookseller app using Flutter (Dart) – I have found several peak-points that require optimization .

Flutter, powered by Dart language, is an open-source SDK by Google to develop apps for Android, iOS, Linux, Windows, MacOS and the web from a single codebase .

Here, I share tips to optimize a Flutter app, from my experience, that scales:

  1. Avoid heavy-works on the main thread
  2. Employ isolates wherever necessary
  3. Mark static widgets as const
  4. Avoid rebuilding widgets
  5. Remove Container() if unnecessary
  6. Prefer SizedBox() or Nil() instead of blank Container()
  7. Use StatelessWidget if StatefulWidget is of no use
  8. Keep the Widget build() as simple as possible
  9. Avoid color gradients
  10. Add shrinkWrap:true to ListView.builder
  11. Apply RepaintBoundary() in animation works
  12. Cache both local and networked images
  13. Employ dispose() to release object memories
  14. Compress (encode and decode) data
  15. Make Color codes const
  16. Keep Flutter and Dart up-to-date
  17. Produce architecture-specific builds separately for phones, tablets and desktops

These tips will ensure a fast & lightweight high-performing Flutter app that runs on multiple platforms .

Published by Farial Mahmod Tishan

Life-long learner. Developing mobile apps and solving coding challenges.

Leave a comment

Design a site like this with WordPress.com
Get started