Skip to content

Specify that widget rebuilds is only available in debug-mode#9733

Open
Bingtagui404 wants to merge 1 commit intoflutter:masterfrom
Bingtagui404:fix/widget-rebuild-debug-mode-9730
Open

Specify that widget rebuilds is only available in debug-mode#9733
Bingtagui404 wants to merge 1 commit intoflutter:masterfrom
Bingtagui404:fix/widget-rebuild-debug-mode-9730

Conversation

@Bingtagui404
Copy link

Fixes #9730

Description

When running an app in profile-mode, the Performance panel previously showed a disabled "Count widget builds" checkbox without explaining why it was disabled. The trackRebuildDirtyWidgets service extension relies on debugOnRebuildDirtyWidget, which is only available in debug-mode.

This change checks whether the connected app is a profile build using connectedApp?.isProfileBuildNow (consistent with the approach in more_debugging_options.dart). When it is a profile build, the checkbox and clear button are removed and replaced with a centered message:

Rebuild information is not available for this frame.
Widget rebuild counts are only available when running an app in debug-mode.

When running in debug-mode, the existing checkbox and rebuild stats table remain unchanged.

Changes

  • packages/devtools_app/lib/src/screens/performance/panes/rebuild_stats/rebuild_stats.dart: Added an early return in _RebuildStatsViewState.build() that shows an informational message when the connected app is a profile build.

When running an app in profile-mode, the Performance panel previously
showed a disabled "Count widget builds" checkbox without explaining why
it was disabled.

This change checks whether the connected app is a profile build using
`isProfileBuildNow`. When it is, the checkbox and clear button are
removed and replaced with a message explaining that widget rebuild
counts are only available in debug-mode.

Fixes flutter#9730
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant