The Flutter inspector in DevTools

On supported IDEs, the plugin already offers ways to access the widget inspector, using the Flutter widget inspector tool under the hood. It is also accessible in the DevTools suite:

As you can see, the widget tree is presented and we can access all details about widgets. For web developers, this will look very similar to element explorer in web developer tools, like the one in Chrome, for instance.

Like profiler and debugger tools, exploring the widget tree in details can be extremely helpful to find out layout issues that would be difficult without visualization of the tree.

Also, looking at the previous screenshot, we had a small hint to turn on tracking widget creation. When we skip this flag, the tool will show a deeper tree than we might expect; this why it exposes intermediate widgets besides the ones that we define in our application. When we enable it, the tree will look much simpler:

With this, we have a tree that looks much more like the one defined in our code, making it easier to track issues. Also, we have widget property details that also assist in finding small layout problems.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.147.66.178