返回介绍

Flutter inspector

发布于 2019-12-09 21:31:32 字数 2884 浏览 1103 评论 0 收藏 0

The Flutter widget inspector is a powerful tool for visualizing and exploring Flutter widget trees.

The Flutter framework uses widgets as the core building block for anything from controls (text, buttons, toggles, etc.) to layout (centering, padding, rows, columns, etc.). The inspector is powerful tool for visualizing and exploring Flutter these widget trees. It can be helpful when:

  • Understanding existing layouts
  • Diagnosing layout issues

IntelliJ Flutter inspector window

Getting started with the inspector

The inspector is currently available in the Flutter plugin for Android Studio, or IntelliJ IDEA.

To start click “Select widget” on the Flutter inspector toolbar, and then click on the device to select a widget. The selected widget is then highlighted on the device and in the widget tree.

Select Demo

You can then browse around the interactive widget tree in the IDE to view nearby widgets and see their field values. If you are trying to debug a layout issue, then the Widget layer’s tree may be insufficiently detailed. In that case, click the Render Tree tab to view the render tree corresponding to the same location in the tree. When debugging layout issues, the key fields to look at are the size and constraints fields. The constraints flow down the tree, and the sizes flow back up.

Switch Trees

For a more complete demonstration of the inspector, see the DartConf 2018 talk.

Feedback

If you have suggestions, or encounter issues, please file an issue in our tracker!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文