DevTools
A suite of performance and debugging tools for Dart and Flutter — your essential toolkit for building high-quality apps.
DevTools is a suite of performance and debugging tools for Dart and Flutter. It's an essential part of your Flutter development workflow, helping you diagnose issues , profile performance , and debug your applications effectively.
💡 Key Insight
DevTools is not a replacement for your IDE — it's a complement . You use DevTools alongside your existing IDE or command-line workflow to get deep insights into your app's behavior.
There are several ways to launch DevTools depending on your workflow:
flutter pub global run devtools
or use the link from
flutter run
output
http://localhost:9100
(or the port shown in your terminal)
# 1. Run your app in profile mode
flutter run --profile
# 2. Look for the DevTools link in the output
# An Observatory debugger and DevTools server is available at:
# http://127.0.0.1:9100/
# 3. Or launch DevTools separately
flutter pub global run devtools
# 4. Connect to your running app
# Use the VM Service URL from flutter run output
💡 Pro Tip: Always Use Profile Mode
For accurate performance measurements, always run your app in
profile mode
(
flutter run --profile
). Debug mode includes extra assertions and checks that
slow down performance and give misleading results.
The Performance tab helps you diagnose UI jank and frame rendering issues. It's your first stop when your app feels slow or stuttery.
📊 What You Can See
- Frame timing – See each frame's duration (green = good, red = jank)
- UI thread – Time spent building widgets
- Raster thread – Time spent rendering pixels
- CPU usage – Overall CPU utilization
- Timeline events – Detailed breakdown of what happened in each frame
// 1. Janky frames (red bars in the timeline)
// → Look for frames taking > 16ms
// 2. Long UI thread work
// → Look for expensive build() methods
// 3. Long raster thread work
// → Look for expensive rendering (saveLayer, opacity, clipping)
// 4. Frequent layout passes
// → Look for intrinsic passes or excessive layout
✅ Performance Checklist
- Check frame timing – Look for frames > 16ms
- Check UI thread – Look for expensive widget builds
- Check raster thread – Look for expensive rendering operations
- Check for saveLayer() – Enable checkerboard rendering
- Check for rebuilds – Use widget rebuild tracking
The Widget Inspector lets you visualize and explore the widget tree of your running app. It's invaluable for understanding your app's structure and debugging layout issues.
🔍 What You Can Do
- Select widgets – Click on widgets in the app or the tree
- View properties – See all properties of a selected widget
- See layout – Visualize how widgets are laid out
- Track rebuilds – See which widgets are rebuilding frequently
- Find widget – Search for widgets by type or property
// 1. Find a specific widget
// Use the search bar or click on the widget in your app
// 2. Check widget properties
// Select a widget and see all its properties in the details pane
// 3. See rebuild frequency
// Enable "Show widget rebuild information" in the Performance tab
// 4. Check for overflow
// Enable "Show layout overflow" to see layout errors
✅ Widget Inspector Tips
- Show widget rebuilds – Identify widgets that rebuild too often
- Show layout overflow – Find layout errors and overflow issues
- Enable slow animations – Slow down animations for debugging
- Use the selection tool – Click on widgets in your app to select them
The Memory tab helps you debug memory issues and find memory leaks in your application.
💾 What You Can See
- Memory usage – Real-time memory consumption
- GC events – Garbage collection activity
- Heap snapshots – Detailed memory snapshots
- Memory allocation – Where memory is being allocated
// 1. Frequent GC events
// → Check for excessive object allocation
// 2. Increasing memory usage
// → Look for memory leaks (unreleased objects)
// 3. Large memory spikes
// → Look for large allocations (images, lists)
// 4. Not disposing controllers
// → Check for AnimationController, StreamController leaks
✅ Memory Best Practices
- Dispose controllers – Always dispose AnimationController, StreamController
- Use lazy loading – Only load what you need, when you need it
- Avoid large objects – Break up large widgets and images
- Use const widgets – Reduces memory allocation
- Monitor GC frequency – Excessive GC means too much allocation
The CPU Profiler helps you identify which functions are taking the most CPU time, making it easier to optimize your code.
🧠 What You Can Do
- Record CPU samples – Capture CPU usage over time
- View call stacks – See which functions are called
- Flame chart – Visualize CPU usage over time
- Bottom-up view – See which functions consume the most CPU
// 1. Start recording
// Click the record button in the CPU Profiler
// 2. Perform the action you want to profile
// e.g., scroll a list, navigate to a screen
// 3. Stop recording
// Click the stop button
// 4. Analyze the results
// Look for functions that take the most time
✅ CPU Profiling Tips
- Profile in release mode – For accurate results
- Focus on expensive operations – Look for functions > 1% of CPU
- Check the flame chart – Visually identify bottlenecks
- Compare profiles – Profile before and after optimizations
Follow these steps to debug common issues using DevTools:
Debug mode includes extra assertions that slow down performance and give misleading results. Always use profile mode for performance analysis.
Run
flutter run --profile
for accurate performance measurements.
Many performance issues are in the raster thread (rendering), not the UI thread (building). Check both.
Look at both the UI thread (build) and raster thread (render) in the Performance tab.
Not disposing controllers and streams leads to memory leaks that degrade performance over time.
Always call
dispose()
on AnimationController, StreamController, and other
disposable objects.
Guessing about performance issues is inefficient. Use DevTools to find the actual bottlenecks.
Make DevTools part of your development workflow. Profile early and often.
📚 Learning Resources
- Flutter DevTools Documentation – Official docs
- Performance View – Deep dive into performance profiling
- Memory View – Memory debugging guide
- Network View – Network request debugging
🔗 Related Lessons
- Performance Optimization – Apply the optimizations you measure
- Animations – Debug animation performance
- Slivers – Profile scrolling performance
🎯 Key Takeaway
DevTools is your essential toolkit for building high-quality Flutter apps. Use the Performance tab to diagnose jank, the Widget Inspector to understand your UI, the CPU Profiler to find expensive operations, and the Memory tab to catch leaks. Always profile in release mode and make DevTools a regular part of your development workflow. With DevTools, you can build faster, smoother, and more reliable Flutter applications.