Specify that widget rebuilds is only available when running in debug-mode

未关闭 适合新手
#9,730 4 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
dart
领域
devtools

调研方向

从性能面板中渲染已禁用的 widget 重建复选框和 "To see widget rebuilds" 文本的代码开始;跟踪它如何处理 trackRebuildDirtyWidgets service extension,以及 packages/flutter/lib/src/widgets/debug.dart 中描述的 debugOnRebuildDirtyWidget 限制。完成的标准是:profile-mode 帧在没有复选框的情况下显示指定的不可用消息,同时 debug-mode 行为仍然可用。

由索引模型根据 Issue 内容生成。

描述

contributions welcome good first issue P2 screen: performance

Currently when you run your app in profile-mode, the performance panel shows a disabled checkbox that makes it seem like it should be possible to "count widget builds" (see screenshot below)

In actuality, "count widget builds" relies on the trackRebuildDirtyWidgets service extension, which uses debugOnRebuildDirtyWidget. This is only available in debug-mode: https://github.com/flutter/flutter/blob/f9e809913240552c391bf31b1cfdbdf410224d8c/packages/flutter/lib/src/widgets/debug.dart#L59

Instead of "To see widget rebuilds for Flutter frames, enable CountWidgetRebuilds", we should remove the checkbox and update the text to say "Rebuild information not available for this frame. Widget rebuild counts are only available when running an app in debug-mode."

Image
主要语言
Dart
星标
1.7k
派生
405
平均合并
4 天 23 小时
30 天内合并 PR
12

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

flutter/devtools 的其他 Issue

查看 flutter/devtools 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。