Skip to content

flutter_tools: Remove unused parameters#185347

Merged
auto-submit[bot] merged 2 commits into
flutter:masterfrom
srawlins:unused-flutter_tools
May 4, 2026
Merged

flutter_tools: Remove unused parameters#185347
auto-submit[bot] merged 2 commits into
flutter:masterfrom
srawlins:unused-flutter_tools

Conversation

@srawlins

Copy link
Copy Markdown
Contributor

Work towards dart-lang/sdk#47839

The lint rule will start reporting these unused parameters. These are parameters for which no arguments are ever given, so they are dead code.

@srawlins srawlins added the CICD Run CI/CD label Apr 21, 2026
@flutter-dashboard

Copy link
Copy Markdown

It looks like this pull request may not have tests. Please make sure to add tests or get an explicit test exemption before merging.

If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix?

Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. If you believe this PR qualifies for a test exemption, contact "@test-exemption-reviewer" in the #hackers channel in Discord (don't just cc them here, they won't see it!). The test exemption team is a small volunteer group, so all reviewers should feel empowered to ask for tests, without delegating that responsibility entirely to the test exemption group.

@github-actions github-actions Bot added the tool Affects the "flutter" command-line tool. See also t: labels. label Apr 21, 2026

@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 onComplete parameter from the _TaskQueueItem constructor in task_queue.dart. The review feedback suggests removing the corresponding onComplete field to avoid dead code and potential compilation errors, consistent with the repository's style guide to only include necessary code.


class _TaskQueueItem<T> {
_TaskQueueItem(this._closure, this._completer, {this.onComplete});
_TaskQueueItem(this._closure, this._completer);

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

The onComplete field in _TaskQueueItem appears to be unused now that the constructor parameter has been removed. Since this.onComplete was used in the constructor, there must be a corresponding field in the class. If this field is no longer needed, it should be removed along with any code that references it to avoid dead code. Additionally, if the field is final, leaving it in the class without an initializer will cause a compilation error.

References
  1. The style guide advises to 'Write what you need and no more'. Leaving an unused field after removing its constructor parameter violates this principle of avoiding dead code. (link)

@github-actions github-actions Bot removed the CICD Run CI/CD label Apr 30, 2026
@srawlins srawlins added the CICD Run CI/CD label Apr 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CICD Run CI/CD tool Affects the "flutter" command-line tool. See also t: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants