DevTools is a tooling suite for Flutter and Dart developers consisting of layout inspection tools, performance tools, memory tools basically all the debugging tools that you need to be an efficient and effective Flutter developer bundled into a single web suite.
Usage of DevTools:
The Flutter DevTools can be used to perform a number of operations. Some of them are listed below:
- UI inspection.
- App state inspection.
- Diagnose UI junk performance.
- Diagnose issues with flutter apps.
- DevTools use for CPU profiling.
- Network profiling for an app.
- Source-level debugging of an app.
- Debug memory issues in a Flutter or Dart or command-line app.
- View general log and diagnostics information of an app.
- Analyze your code and app size of the flutter app.
Installing DevTools:
1. Install Flutter DevTool in Android Studio
Follow the below steps to install DevTools in your Android Studio:
- Step 1: Install the Flutter plugin in Android Studio, if you don’t already have it installed. This can be done using the normal Plugins page in the Android Studio settings. Once settings->plug-ins page is open, you can search flutter in the marketplace and install the plugin.
- Step 2: You first run a Flutter app. Ensuring that you have a device connected to the project, and clicking the Run or Debug toolbar buttons.
- Step 3: Launch DevTools from the toolbar/menu in your flutter project. Once an app is running successfully, start DevTools implementing the following instruction one by one:
- Open DevTools toolbar action from Run view.
- DevTools toolbar action visible in the Debug view. (if debugging)
- DevTools action from the More Actions menu in Inspector view in your flutter project.
2. Installing DevTools from VS Code
Follow the below steps to install DevTools from VS Code:
- Step 1: To use the DevTools from VS Code firstly install the Dart extension also you need to install the Flutter extension for debugging flutter applications.
- Step 2: Launch an application to debug your application. Start debugging in VS Code by clicking Run > Start Debugging (F5).
- Step 3: If once debugging started, the Dart Opens DevTools command becomes available in the VS Code command palette:
Screenshot showing Open DevTools command:
When you run your app the first time, you will be prompted to activate or upgrade DevTools. The below image shows an Active DevTools command:
Clicking the Open button to activate the DevTools package for your application. After this, DevTools launches in your browser and automatically connects to your debug session as shown below:
When DevTools is in an active state, you’ll see them in the status bar of VS Code.
3. Install DevTools from the command line
If you have flutter on your computer, you can run:
flutter pub global activate devtools
The above command installs or updates DevTools on your machine or computer. Launch the DevTools from the application server. Run the local webserver. To do that runs the following commands:
flutter pub global run devtools
On the command line, the output looks something like this:
Serving DevTools at http://127.0.0.1:9100
Start an application to debug:
Start a Flutter application or a Dart command-line application. The command for flutter app:
cd path/to/flutter/app
flutter run
You need to have a device connected for the flutter run to work. After the app starts, Following message in your terminal:
An Observatory debugger and profiler on Galaxys20 is available
at: http://127.0.0.1:50976/Swm0bjIe0hj=/
Note that this URL, we will use to connect our app to DevTools.
Connect DevTools to target app:
Once All things set up, debugging through DevTools is very simple as opening a Chrome browser window and navigating to the below link:
http://localhost:9100
After DevTools opens, the dialog box pop-up you will get the below Logging view:
Paste the URL, which you already note from running your app (example, http://127.0.0.1:50976/Swm0bjIe0hg=/) into the connect dialog to connect your app to DevTools to debugging.
The Flutter inspector:
The Flutter widget inspector is a great tool for visualizing and monitoring the Flutter widget trees of your application. The Flutter framework uses widgets as the core building block for control anything (such as text, buttons, etc.), to layout (such as centering, padding, row, and column. Inspector helps to visualize and explore widget trees, and can be used for the following:
- With the help of the inspector, you can easily understand the existing layouts of your app.
- Diagnosing layout issues in your application if anyone arises.
Debugging layout issues visually
The following is an instruction to the features available in the inspector’s toolbar in flutter's DevTools:
- Select widget mode: Select a widget and click on the button on the device to inspect it.
- Refresh tree: This button used to reload the current widget info.
- Slow Animations: It is used to slow down animations to enable visual inspection.
- Debug Paint: Debug Paint button used to add visual debugging, Which hints to the rendering that displays borders, padding, alignment, and spacers, etc.
- Paint Baselines: Use of each RenderBox to paint a line at each of its text baselines in the project.
- Repaint Rainbow: Repaint Rainbow allows rotating colors on layers when repainting.
- Debug Mode Banner: It is used to display the debug banner even when running a debug build.
Inspecting a widget:
Flutter Layout Explorer
The Flutter Layout Explorer allows you to better understand Flutter layouts. It supports the only exploration of flex layouts but it is possible that it will be extended in the future. To use the Layout Explorer, select the following tab to display the Layout Explorer feature.
The Layout Explorer visualizes how to Flex widgets and their children. The explorer identifies the main axis and cross axis and the current alignment in your application when you debugging it. Also, explorer shows layout constraint violations and render overflow errors in your app. During debugging sessions violated layout constraints are colored red, and overflow errors are presented in the standard “yellow-tape” pattern, as you might see on a running device in your emulator. All the above and following visualizations aim to understand easily, why overflow errors occur as well as how to fix them.

The Timeline view:
The timeline view provides us, timing, and performance information for the currently debugging applications. It contains three-part, each part increasing in granularity.
- Flutter frames chart.
- Timeline events chart.
- CPU profiler.
Also, the timeline view supports importing and exporting of timeline data files.
Flutter frames chart:
This frame chart contains Flutter's frame information for your application. Every single bar in the chart represents a single Flutter frame. The bars, which are color-coded to highlight the different portions of work that occur when rendering a Flutter frame as shown below:
Selecting a bar from the above chart centers the flame chart below on the timeline events corresponding to the selected Flutter frame which is colored blue in the chart as shown below:

The User Interface:
The UI executes Dart code in the Dart VM. It includes code from your application and Flutter framework. When you create an app and display a scene, this thread creates a layer tree, device-agnostic painting commands, and sends the layer tree to the raster thread which will be rendered on the device.
The Raster:
The raster thread (called GPU thread), executes graphics code from Flutter Engine. This thread takes the layer tree and displays it with the help of the GPU. It cannot directly access the raster thread or its data.
The Jank:
Whenever a frame becomes janky, the jank frame visible with a red overlay. A frame is janky when it takes more than ~16 ms to complete (for 60 FPS devices) whenever this target is missed UI dropped frames. Achieving frame rendering rate of 60 FPS, every frame must render in ~16 ms or less.
The Timeline events chart:
The timeline events chart displays all event trace from the application. The Flutter framework shows timeline events as it works to build frames, draw scenes, and track other activities. All events show up here in the Timeline.

The Flame chart:
The Flame chart shows CPU samples for the selected frame event (such as Layout etc.). This profiler should be viewed as a top-down stack trace, where the top-most stack frame calls the one below it, and the width of each stack frame represents the amount of time it consumed the CPU during the inspection or debugging as shown below:

The Call tree:
The call tree displays the method trace for the CPU profile. This table of call tree is a top-down representation of the profile which means that a method can be expanded to describe its callees.
- Total time: Time the method spent executing the code with its callees.
- Self time: Time the method spent to executing its own code.
- Method: Name or identity of the called method.
- Source: File path for the method call site in your machine.
An image of the same is shown below:

The Bottom-up:
The bottom-up view displays the method trace for the CPU profile but, accordingly to name, it is a bottom-up representation of the profile. This means that every top-level method in the table is actually the last method in the call stack for a given CPU sample.

The Memory view:
The allocated object in any application created using a class constructor (like using new MyClass() or MyClass()) live in a portion of memory known as the heap. Memory page in DevTools lets you peek at how an isolate is using memory at a given time. With the help of Monitor Allocations and Reset options, anyone can analyze accumulator counts. The accumulators can be used to study the rate of memory allocations for any dart app, if you suspect your application is leaking memory or has other bugs relating to memory allocation you can easily figure out it on the memory page. Memory profiling contains six parts:
- Chart of Memory overview
- Chart for Android-only memory
- Event timeline
- Monitoring and setting up of Dart total instances, size, and accumulator monitoring to detect memory leaks in applications
- Snapshots of all live memory class instances, sentinels, etc.
A time-series graph is used to visualize the state of the Flutter memory at successive intervals of time over your application. Every data point on the chart corresponds to the time stamp (x-axis) of measured quantities and (y-axis) of the heap. Example, usage, capacity, external, garbage collection, resident set size, and many more.

The Performance view:
The performance view provides us feature to record and profile a session from your Dart or Flutter application. If you are running a Flutter application, please build a profile build to analyze the performance of your application.

The Network View:
The network view allows you for inspecting web socket traffic like HTTP and HTTPS from your Dart or Flutter application. Screenshot of the network screen:
Some examples of filter queries:
my-endpoint m:get t:json s:200
https s:404
The Debugger:
DevTools contains a fully originated source-level debugger which is supporting breakpoints, stepping, and variable inspection. When anyone opens their debugger tab, they should see the source for the main entry-point for your app loaded in the debugger. For browsing around more of your application sources, click Libraries (top right) or use an alternate method the hotkey command ⌘ + P / ctrl + P. This will open the libraries window and allow you to search for other source files from your application.
In addition, the Resume button continues regular execution of the application in which you worked on.
Concept of App size tool:
The app size tool frees you to analyze the total size of your app and can view a single snapshot of “size information” using the Analysis tab, or compare two different snapshots of “size information”, which contains size data for Dart code of your application. The flutter compiler attempts to optimize your app’s size by removing pieces of code that are unused or unreachable(garbage code) in your application.
Analysis tab:
In the analysis tab you can view the hierarchical structure of the size data using the treemap and table, view code attribution data (i.e. why a piece of code is included in your compiled application) using the dominator tree and call graph.

Loading a size file:
Whenever you open the Analysis tab, instructions to load an app size file. Drag and drop an app size file into the dialogbox and click to button “Analyze Size”.

Diff tab:
The diff tab provides us to compare two snapshots of size information, two size information files you are comparing should be generated from two different versions of the same app, for example, the size file generated before and after changes to your application code can visualize the difference between the two data sets using the tree-map and table.

Similar Reads
Basics
Flutter TutorialThis Flutter Tutorial is specifically designed for beginners and experienced professionals. It covers both the basics and advanced concepts of the Flutter framework.Flutter is Googleâs mobile SDK that builds native Android and iOS apps from a single codebase. It was developed in December 2017. When
7 min read
Flutter | An introduction to the open source SDK by GoogleFlutter is Googleâs Mobile SDK to build native iOS and Android, Desktop (Windows, Linux, macOS), and Web apps from a single codebase. When building applications with Flutter, everything is Widgets â the blocks with which the flutter apps are built. They are structural elements that ship with a bunch
5 min read
Flutter - Architecture ApplicationFlutter architecture application mainly consists of: WidgetsGesturesConcept of StateLayersWidgetsWidgets are the primary component of any flutter application. It acts as a UI for the user to interact with the application. Any flutter application is itself a widget that is made up of a combination of
3 min read
Android Studio Setup for Flutter DevelopmentThis article will show how to set up Android Studio to run Flutter Applications. Android Studio is one of the popular IDE( integrated development environment  ) developed by Google itself to create cross-platform Android applications. First, you have to install Android Studio version 3.0 or later, a
3 min read
Getting Started with Cross-Platform Mobile Application using FlutterFlutter is an open-source mobile application development SDK created by Google to develop cross-platform mobile applications. Flutter makes it extremely easy and fast for even novice programmers (computer programmers who are not experienced in any programming languages) to build high-quality and res
7 min read
Flutter Development in Ubuntu 20.04In this article, let's look at how you can set up a development environment for Flutter if you're using Ubuntu 20.04. It was difficult earlier and was kind of a nightmare to get it done. But now, it has changed, and anyone can easily set up a flutter development environment on their Ubuntu system in
5 min read
Key Widgets
UI Components
Flutter - TabsTabs are the part of the UI that navigates the user through different routes(ie, pages) when clicked upon. The use of tabs in applications is standard practice. Flutter provides a simple way to create tab layouts using the material library. In this article, we will be exploring the same in detail.To
2 min read
Flutter - Horizontal ListIn Flutter there can be Two types of lists, namely, horizontal list and vertical list. Both these lists are created using the ListView constructor and assigning the scrollDirection parameter. By default, the scroll direction parameter is vertical for a vertical list but it can be overridden by passi
3 min read
Flutter - Expansion Tile CardThe Expansion Tile Card works similarly to that of the Flutter SDK's standard expansion tile. But it uses the style used by Google itself in its products to raise a tile. It can be called a better version of the Flutter's ExpansionTileCard. In this article, we will look into the process of implement
3 min read
Icon Class in FlutterIcon class in Flutter is used to show specific icons in our app. Instead of creating an image for our icon, we can simply use the Icon class for inserting an icon in our app. For using this class you must ensure that you have set uses-material-design: true in the pubsec.yaml file of your object.Synt
2 min read
Expanded Class in FlutterWhen we create any child of a row or column we provide the size of the widget according to the screen size but sometimes when we provide more size of child as compared to screen size we get a warning and our widget goes out of the screen for resolving this we put a child of a row or column in an exp
3 min read
Flutter - DialogsThe dialog is a type of widget which comes on the window or the screen which contains any critical information or can ask for any decision. When a dialog box is popped up all the other functions get disabled until you close the dialog box or provide an answer. We use a dialog box for a different typ
5 min read
Flutter - Circular & Linear Progress IndicatorsProgress Indicator in any application displays the time which is needed for some tasks to complete such as downloading, installation, uploading, file transfer, etc. This shows the progress of a task or the time to display the length of the processes.In Flutter, progress can be displayed in two ways:
4 min read
Flutter - Staggered Grid ViewStaggered Grid View is a type of layout that is used to display images and posts. As you see in various social platforms such as Pinterest, Instagram and many more. The main feature of Staggered Grid View is that it makes the layout beautiful and develop a great User Experience. Staggered Grid View
4 min read
Design & Animations
Customizing Fonts in FlutterCustomization is everywhere, from documents to apps, we can customize everything as we want to. The power of customization is humongous, and it has revolutionized the way we look at technology in this world. Just like how printing "Hello World", is the basic step towards learning a new programming l
4 min read
Flutter - Skeleton TextIn Flutter, the skeleton_text library is used to easily implement skeleton text loading animation. Its main application in a flutter app is to assure its users that the servers are working but running slow, but the content will eventually load. It also enhances the User Interface if the user connect
3 min read
Flutter - ThemesThemes are an integral part of UI for any application. Themes are used to design the fonts and colors of an application to make it more presentable. In Flutter, the Theme widget is used to add themes to an application. One can use it either for a particular part of the application like buttons and n
3 min read
Flutter - Lazy LoaderThe Lazy loader is a wrapper to the ScrollView that enables lazy loading. It is very useful in situations where the application's intent is to show endless content in a ListView. For instance, Instagram, Facebook, Youtube and most social networking platforms use them to deliver an endless stream of
5 min read
Flutter - UI OrientationAll applications should be able to adjust their User Interface (UI) based on the orientation of the phone. By orientation, we implicate the portrait and landscape mode in smartphones rather the physical orientation. In, Flutter it is done so by using the OrientationBuilder, which determines the app'
2 min read
Flutter - Animation in Route TransitionRoutes are simply Pages in Flutter applications. An application often needs to move from one page to another. However, animations can be used to make these transitions smoother. These animations can be used to curve or tween the Animation object of the PageRouteBuilder class to alter the transition
3 min read
Flutter - Physics Simulation in AnimationPhysics simulation in Flutter is a beautiful way to Animate components of the flutter app to make it look more realistic and interactive. These can be used to create a range of animations like falling objects due to gravity to making a container seem attached to a spring. In this article, we will ex
4 min read
Flutter - Radial Hero AnimationA Radial transformation means turning a circular shape into a square shape. In Radial Hero animation the same is done with a Hero. In Flutter, a Hero Widget is used to create a hero animation. A hero in this context refers to a widget that moves in between screens. This is one of the most fundamenta
3 min read
Flutter - Hinge AnimationAnimations are a big part of the Flutter application. It makes an app sweet to the eyes and equally user-friendly. In this article, we will discuss in detail the Hinge animations. In Flutter there are two ways to work with animations namely:A pub packageAnimated Builder WidgetIn this article, we wil
4 min read
Flutter - Lottie AnimationVisualization is an integral part of any application. Animations can highly glorify the UI of an app, but animations can be hectic to implement for an application. This is where the Lottie animation comes in. Lottie is a JSON-based animation file. It can be used both as a network asset and a static
3 min read
Forms & Gestures
Navigation & Routing
URLs in FlutterWhile surfing the net, every user will come across many buttons, text, etc., that would redirect the user to a different webpage in the same tab or in a different tab when clicked. In the same way, when a developer links a URL to a button or text in an app, the app will open the website when clicked
5 min read
Routes and Navigator in FlutterRoute: Apps are the new trend. The number of apps available in the Play Store and App Store nowadays is quite a lot. The apps display their content in a full-screen container called pages or screens. In flutter, the pages or screens are called Routes. In android, these pages/screens are referred to
4 min read
Flutter - WebSocketsWebSockets are used to connect with the server just like the http package. It supports two-way communication with a server without polling.In this article, we will explore the below-listed topics related to WebSockets in Flutter:Connecting to a WebSocket serverListen to messages from the server.Send
3 min read
Flutter - Named RoutesAn app has to display multiple screens depending upon the user's needs. A user needs to back and forth from the multiple screens to the home screen. In, Flutter this is done with the help of Navigator.Note: In Flutter, screens and pages are called routes. Steps to Implement Named Routes in FlutterSt
3 min read
Flutter - Arguments in Named RoutesNavigating between the various routes (i.e, pages) of an application in Flutter is done with the use of Navigator. The Navigator uses a common identifier to transition between routes. One can pass arguments to these routes using the arguments parameter of Navigator.pushNamed() method. Arguments can
4 min read
Multi Page Applications in FlutterApps are widely used by humans in this techie world. The number of apps in the app store is increasing day by day. Due to this competition, app developers have started to add a number of features to their apps. To reduce this complexity, the content of the app is mostly divided into various pages so
5 min read
Flutter - Updating Data on the InternetIn today's world, most applications heavily rely on fetching and updating information from the servers through the internet. In Flutter, such services are provided by the http package. In this article, we will explore the same. Let's see a sample video of what we are going to develop.Sample Video:St
5 min read
Flutter - Fetching Data From the InternetIn today's world, most applications heavily rely on fetching information from the servers through the internet. In Flutter, such services are provided by the http package. In this article, we will explore this concept.Steps to Implement Data Fetching from the InternetStep 1 : Create a new flutter ap
4 min read
Flutter - Deleting Data On The InternetIn this article, we will explore the process of deleting data on the internet. Before deleting data on the internet, we will fetch the data first and then will delete the data.Steps to implement Deleting Data on the InternetStep 1 : Create a new flutter applicationCreate a new Flutter application us
4 min read
Flutter - Sending Data To The InternetInteracting with the Internet is crucial for most apps to function. In Flutter, sending data to the internet is one of them, and the http package is used to send the data to the internet. In this article, we will explore the same topic in detail. Steps to Implement Sending Data to the InternetStep 1
5 min read
Flutter - Send Data to ScreenInteraction with the UI is an integral part of any application. But more often than not, the information needs to be sent from one screen to another. For instance, say you need to pass data regarding a selected or tapped component of the UI to another route(i.e., page). In this article, we will expl
4 min read
Hardware Interaction
Gallery Access and Camera in FlutterWe can add images from the gallery using the image_picker package in Flutter. For this, you'll need to use your real device.Steps to Implement Gallery and Camera AccessStep 1: Create a new flutter applicationCreate a new Flutter application using the command Prompt. To create a new app, write the be
3 min read
Camera Access in FlutterTo add images from the camera in Flutter, we'll use the image_picker package. For this, you'll need to use your real device.Follow the below steps to display the images from the cameraStep 1: Create a new Flutter ApplicationCreate a new Flutter application using the command Prompt. To create a new a
3 min read
Background local notifications in FlutterSometimes user wants some essential features like the latest news updates, latest articles updates, weather condition alert, complete his/her profile update, future events update and much more in his/ her Android or iOS device without opening App and if you would like to develop this kind of Android
6 min read
Restrict Landscape mode in FlutterIn this article, we'll learn how to restrict landscape mode in the flutter app. A production-ready app should be free from all sorts of bugs and errors. Mostly, we design our app for portrait orientation if we flip to landscape orientation, the UI might not be adjusted for that. So, there are two ca
2 min read
Sample Flutter Apps
Basic Quiz App In FlutterFlutter SDK is an open-source software development kit for building beautiful UI that is natively compiled. Currently, it is available as a stable version for iOS and Android OS. In this app, we are going to have the features or modules mentioned below:Five multiple-choice questions ( more questions
8 min read
A Hello World App using FlutterIn Flutter, everything is a Widget, and by using predefined widgets, one can create user-defined widgets just like using int, float, and double can create user-defined data types. In Flutter there are three types of widgetsStateless WidgetStateful WidgetInherited WidgetIn this article, we will use S
3 min read
Flutter - Simple PDF Generating AppFlutter Community has created several packages to work with PDFs in our apps. In this article, we will be creating a simple PDF-generating app. This application will convert plain text to PDF. The packages that we are going to need are listed below with their uses:pdf: It is a PDF creation library f
9 min read
Flutter - Magic 8 Ball AppWe will be building a Magic 8-Ball app that will give you the answers to all fun, tricky questions (basically, it is a fun game app that will change its state of image using Textbutton in Stateful widgets). For this, we will use Stateless and Stateful Flutter widgets and a Textbutton. Steps to build
3 min read
Advance Concepts