Skip to content

Removes unused code in DevTools app extensions/ and framework/ directories#9909

Open
kenzieschmoll wants to merge 11 commits into
flutter:masterfrom
kenzieschmoll:dcm-1
Open

Removes unused code in DevTools app extensions/ and framework/ directories#9909
kenzieschmoll wants to merge 11 commits into
flutter:masterfrom
kenzieschmoll:dcm-1

Conversation

@kenzieschmoll

Copy link
Copy Markdown
Member

Work towards #9906

Chained on top of #9908

@kenzieschmoll
kenzieschmoll marked this pull request as ready for review July 22, 2026 00:13
@kenzieschmoll
kenzieschmoll requested a review from a team as a code owner July 22, 2026 00:13
@kenzieschmoll
kenzieschmoll requested review from bkonyi and srawlins and removed request for a team July 22, 2026 00:13

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enables Dart Code Metrics analysis for the extensions and framework directories by removing them from the exclusion list in analysis_options.yaml. This led to cleaning up unused fields, constants, and adding ignore comments for false positives. Additionally, an assertion-based debug check in HomeScreen was refactored to use if (kDebugMode). Feedback was provided regarding a potential "setState() called after dispose()" exception in HomeScreen due to the asynchronous nature of _debugInitVmServiceCache, along with a suggestion to maintain consistency by updating another assertion to use if (kDebugMode).

_debugInitVmServiceCache();
return true;
}());
if (kDebugMode) _debugInitVmServiceCache();

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

[CONCERN] Since _debugInitVmServiceCache is an asynchronous method that calls setState, it can potentially lead to a "setState() called after dispose()" exception if the widget is disposed before the async operation completes. Consider adding a mounted check before calling setState inside _debugInitVmServiceCache.

Additionally, for consistency with this change, consider updating the saving side in _connectHelper (around line 256) to use if (kDebugMode) instead of assert.

References
  1. Prefix every comment with a severity: [MUST-FIX], [CONCERN], [NIT]. (link)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants