Flutter debugging is based on the Dart Observatory tool. Dart Observatory is present in the Dart SDK and helps with profiling and debugging Dart applications such as Flutter apps.
When a Flutter app is started in debug mode (remember the JIT compilation from Chapter 1, An Introduction to Dart), this tool is automatically run, enabling debugging and profiling on the app. By using the flutter run command, you will have the address:port part of the output after the Hot Reload message. This address is the Observatory UI address; we can access it through many web browsers* and this is what it looks like:
It prints different information about the app running, such as the Flutter version, used memory, class hierarchy, and logs. Also, an important additional tool can be used, the debug tool:
In this page, as you can see, we have access to all of the debugging functionalities, such as the following:
- Adding and removing breakpoints
- Run step by step, line by line
- Switch and manage isolates
When you use some IDE like Visual Studio Code or Android Studio/IntelliJ, you will not be using tools such as the Observatory UI directly. IDEs use Dart Observatory under the hood to expose its functionalities through the IDE interface.