Skip to content

Remove unused NetworkRequest.durationDisplay getter and test - #9992

Open
hannah-hyj wants to merge 1 commit into
flutter:masterfrom
hannah-hyj:fix-network-model-lint
Open

Remove unused NetworkRequest.durationDisplay getter and test#9992
hannah-hyj wants to merge 1 commit into
flutter:masterfrom
hannah-hyj:fix-network-model-lint

Conversation

@hannah-hyj

@hannah-hyj hannah-hyj commented Sep 1, 2026

Copy link
Copy Markdown
Member

I keep seeing "Dart Code metric" CI failing in PRs that didn't touch [network_model.dart]
image
This PR is to fix that by removing durationDisplay from NetworkRequest and its corresponding unit test in network_model_test.dart. The getter was not used anywhere in DevTools production code (durations are formatted directly via durationText in DurationColumn and HttpRequestOverviewView), which was causing DCM's check-unused-code to fail with 'getter durationDisplay is used only in tests'.

Pre-launch Checklist

General checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read the Flutter Style Guide recently, and have followed its advice.
  • I signed the CLA.
  • I updated/added relevant documentation (doc comments with ///).

Issues checklist

Tests checklist

  • I added new tests to check the change I am making...
  • OR there is a reason for not adding tests, which I explained in the PR description.

AI-tooling checklist

  • I did not use any AI tooling in creating this PR.
  • OR I did use AI tooling, and...
    • I read the AI contributions guidelines and agree to follow them.
    • I reviewed all AI-generated code before opening this PR.
    • I understand and am able to discuss the code in this PR.
    • I have verifed the accuracy of any AI-generated text included in the PR description.
    • I commit to verifying the accuracy of any AI-generated code or text that I upload in response to review comments.

Feature-change checklist

  • This PR does not change the DevTools UI or behavior and...
    • I added the release-notes-not-required label or left a comment requesting the label be added.
  • OR this PR does change the DevTools UI or behavior and...
    • I added an entry to packages/devtools_app/release_notes/NEXT_RELEASE_NOTES.md.
    • I included before/after screenshots and/or a GIF demo of the new UI to my PR description.
    • I ran the DevTools app locally to manually verify my changes.

build.yaml badge

If you need help, consider asking for help on Discord.

Removes durationDisplay from NetworkRequest and its corresponding unit test in network_model_test.dart. The getter was not used anywhere in DevTools production code (durations are formatted directly via durationText in DurationColumn and HttpRequestOverviewView), which was causing DCM's check-unused-code to fail with 'getter durationDisplay is used only in tests'.

@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 removes the unused @visibleForTesting getter durationDisplay from the NetworkRequest class in network_model.dart, as well as its corresponding unit tests in network_model_test.dart. There are no review comments, and I have no feedback to provide.

@hannah-hyj hannah-hyj closed this Sep 1, 2026
@hannah-hyj hannah-hyj reopened this Sep 1, 2026
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