flutter / flutter/devtools

Provide a way to see inherited values in the Inspector

オープン
#3,084 コメント 1 件 リアクション 1 件 担当者 0 名 GitHub で見る
new feature P2 screen: inspector
主要言語
Dart
スター
1.7k
フォーク
404
平均マージ
6日 17時間
マージ済み PR(30日)
18

説明

I'm often faced with one of the following questions:

* Why does this text look like this? (E.g. why is it gray even though I don't tell it to be gray anywhere?)
* Why doesn't this text react to changes in `TextTheme`?
* Where is this text style attribute coming from, exactly?

Text style comes from an inherited widget called `DefaultTextStyle`. In complex apps, there are several layers of `DefaultTextStyle`, and `Text` merges them all into the final style.

In the IntelliJ Flutter inspector (before DevTools integration), it was possible to show the RenderObject/Element tree, and from there, the developer was able to see the `debugLabel`. It was not perfect, but — as far as I know — it was the only way to debug issues like the ones listed above.

DevTools doesn't have a RenderObject/Element tree (https://github.com/flutter/devtools/issues/636), and afaik there is no other way to get to this information.

Screen Shot 2021-06-03 at 5 06 55 PM

For what it's worth, I don't think the "go to the Element tree" method was the best developer experience. If we can surface this information better, that would be amazing. Like, in the widget tree above, I can imagine showing information about the `Text`'s current `TextStyle`'s `debugLabel` somewhere in that tree.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

まず DevTools Flutter inspector と、RenderObject/Element ツリーが欠落していることに関するリンク先の DevTools issue 636 を確認します。完了条件は、開発者が継承された DefaultTextStyle の値をより明確に調査できるようにすることです。たとえば、ウィジェットツリーに TextStyle の debugLabel を公開します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
dart, flutter
領域
developer-experience, tooling
issue の種類
機能追加
難易度
5/5
見積もり時間
1週間以上
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。