Sitelet https://github.com/flutter/flutter/pull/192734
Skip to content

Add missing @docImport directives for doc comment references - #192734

Merged
szakarias merged 6 commits into
flutter:masterfrom
szakarias:fix-doc-imports
Sep 18, 2026
Merged

szakarias merged 6 commits into
flutter:masterfrom
szakarias:fix-doc-imports

Conversation

@szakarias

@szakarias szakarias commented Sep 14, 2026 •

Copy link
Copy Markdown
Contributor

Add doc imports for elements that are not in the lexical scope of the file they appear in. These currently resolve in dartdoc because it maintains a global lookup of everything it has loaded, but the analyzer's comment_references lint reports them.

Towards #192870 — enabling the comment_references lint.

@flutter-dashboard flutter-dashboard Bot added the CICD Run CI/CD label Sep 14, 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

Copy link
Copy Markdown

This pull request contains changes to Material or Cupertino, which are currently frozen in this repository.

Changes should be made in material_ui and/or cupertino_ui in the flutter/packages repository.

Please refer to #188444 for instructions.

@github-actions github-actions Bot added a: tests "flutter test", flutter_test, or one of our tests framework flutter/packages/flutter repository. See also f: labels. a: animation Animation APIs p: material_ui material_ui package in flutter/packages a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) f: scrolling Viewports, list views, slivers, etc. f: focus Focus traversal, gaining or losing focus labels Sep 14, 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 adds @docImport directives and library; declarations across multiple Dart files in the Flutter repository to improve documentation. The review feedback recommends separating different types of imports (such as package: imports and relative imports) with empty lines in several files to adhere to the Effective Dart style guide.

Comment thread packages/flutter/lib/src/foundation/print.dart
Comment thread packages/flutter/lib/src/widgets/orientation_builder.dart Outdated
Comment thread packages/flutter/lib/src/widgets/radio_group.dart Outdated
Comment thread packages/flutter/lib/src/widgets/sliver_clip.dart Outdated
@github-actions github-actions Bot removed p: material_ui material_ui package in flutter/packages a: accessibility Accessibility, e.g. VoiceOver or TalkBack. (aka a11y) labels Sep 14, 2026

@Piinks Piinks 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.

LGTM

@szakarias
szakarias added this pull request to the merge queue Sep 18, 2026
Merged via the queue into flutter:master with commit a6728d7 Sep 18, 2026
18 checks passed
@szakarias
szakarias deleted the fix-doc-imports branch September 18, 2026 20:55
pull Bot pushed a commit to ScorpiusDraconis83/flutter that referenced this pull request Sep 23, 2026
Follow-up to flutter#192734 and flutter#193087. These are leftovers: four in
`packages/flutter/test`, which the earlier PRs didn't cover, and a few
one-offs.

One fix removes a directive rather than changing a comment:
`image_stream.dart` doc imported `dart:ui`, which made `[Image]` point
at `dart:ui`'s `Image` rather than the widgets library's `Image`.
Nothing needed that doc import: the file's `dart:ui` references are all
prefixed, e.g.`[ui.Image]` and resolve through its real import.

Towards flutter#192870 — enabling the
`comment_references` lint.
pull Bot pushed a commit to fucheng-guo-sun/flutter that referenced this pull request Sep 28, 2026
…ter#193283)

Follow-up to flutter#192734, flutter#193087 and flutter#193216, covering the references
inside `lib/src/material` and `lib/src/cupertino`. Doc comment changes
only.

The changes fall into four kinds:
- missing `@docImport` directives
- qualified member references, e.g. `[value]` →
`[MaterialStatesController.value]`
- a constructor parameter in backticks instead of brackets
(`liveRegion`)
- references to names that do not exist, reworded (`child`, `enabled` in
`cupertino/menu_anchor.dart`)

Towards flutter#192870 — enabling the
`comment_references` lint.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: animation Animation APIs a: tests "flutter test", flutter_test, or one of our tests CICD Run CI/CD f: focus Focus traversal, gaining or losing focus f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants