What is Good Performance?
A screen refreshes about 60 times per second (or 120 on fast phones). Each frame has roughly 16 milliseconds for building and drawing. If your code takes longer, frames are dropped and the app feels stuttery. This is called jank.
flutter run --profile. Debug mode is intentionally slow, and emulators do not show real speed.
1. Use const Widgets
2. Make Rebuilds Small
- Call
setStatein the smallest widget that needs it - Split big
buildmethods into small widgets (as classes, not helper functions) - Use
ValueListenableBuilder,Consumerorref.watchon small parts - Use
context.selectorSelectorto listen to only one field
3. Do Not Do Heavy Work in build()
build runs often. Do not sort big lists, parse JSON or call APIs inside it. Prepare the data in initState, in your state management class or in a repository.
4. Use Lazy Lists
Use ListView.builder and GridView.builder. Avoid ListView(children: [...hundreds of widgets]) and avoid shrinkWrap: true on long lists, because it forces all items to be measured.
5. Handle Images Wisely
- Resize large images on the server, or load a smaller size
- Use
cacheWidth/cacheHeightso Flutter decodes a smaller bitmap - Use the
cached_network_imagepackage to cache downloads
6. Expensive Effects
Opacity, ClipRRect, big shadows and saveLayer operations can be costly, especially in animations. Prefer AnimatedOpacity or FadeTransition, and use RepaintBoundary around parts that animate by themselves.
7. Move Heavy Work to an Isolate
Dart runs your UI code in one thread (the main isolate). A heavy calculation there freezes the screen. An isolate is a separate worker with its own memory, so it does not block the UI.
8. Profile with DevTools
- Run
flutter run --profile. - Open the Performance tab in DevTools.
- Look at the frame chart. Red bars are slow frames.
- Use Track widget rebuilds to find widgets that rebuild too often.
Quick Checklist
| Check | Done? |
|---|---|
| const constructors everywhere possible | Yes |
| Small widgets, local state | Yes |
| Builder constructors for lists | Yes |
| Images are resized and cached | Yes |
| Heavy work in isolates | Yes |
| Tested in profile mode on a real device | Yes |
Conclusion
Most performance problems come from rebuilding too much or doing heavy work on the main thread. Measure, then fix the real bottleneck.

