Debugging your app
Debugging is an important part of software development. Small mistakes, strange behaviors, and complex bugs can be solved with the help of debugging. With this, we can do the following:
- Make logic assertions
- Determine required improvements
- Find memory leaks
- Perform flow analysis
Flutter provides multiple tools to help you debug your app. Specifically, Flutter IDEscan assists with debugging. However, the Dart tooling also allows debugging without the IDE, which we will see in the following sections.
Observatory
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.
You can explore the Observatory by running Dart specific code using the dart run --observe
command where you will receive an address:port
part of the output. This address is the Observatory UI address; you can access it through standard web browsers...