Repository navigation
Support running analysis and dart doc locally as done on pub #9510
Description
Having learned from below, this is a feature request to be able to run dart analyze and dart doc as they would be on pub.
Pub changes analysis options to be able to evaluate everything against a single standard.
This can be hard for developers who won't know, or be able to easily validate their expected pub scores.
In the case of material_ui while trying to debug, I learned I would have to..
- move the package source code out of the mono repo
- change the analysis options manually adding and removing rules to match pub
- set up pana
- run analysis and dart doc
This is really cumbersome just to be able to see what my pub score would be.
Further, if I as a package author publish a package and find out after the fact there was something affecting my score, I'd need to fix it and publish again - hitting pub resources twice for essentially one release.
There should be an option like dart analyze --pub and dart doc --pub or something so I can confidently publish my package without surprises. I would love to have this in CI as well, so that packages accepting contributions can further validate that the standard is maintained before landing a change.
Original issue:
We have been getting the new design packages from Flutter ready to ship, material_ui and cupertino_ui.
Package locations
- https://github.com/flutter/packages/tree/main/packages/cupertino_ui
- https://github.com/flutter/packages/tree/main/packages/material_ui
cupertino_ui is scored better, and already covered by another issue below, but material_ui's score is very poor.
Unfortunately we cannot reproduce all of the issues locally.
Some related issues:
- New call-out box not rendering in dart docs #9488
- @example directive failing analysis despite ignore in place #9489
Not represented by an issue above are a few references that cannot be resolved right now because they are coming from the re-export of the widgets library from the core SDK. We opted to keep this export in the initial version of the material_ui and cupertino_ui packages to facilitate an easier migration. We'll remove the export of the widgets library in a future major release.
Those aside though, the failures reported on pub are vastly more than we are seeing locally.
Looking at material_ui (worst-case)
Local Analysis
$ dart analyze
Analyzing material_ui... 4.1s
No issues found!
Local dart doc --dry-run
$ dart doc --dry-run
warning: internal dartdoc error: Unable to find library for element TargetPlatformVariant.desktop()
from reorderable_list.ReorderableListView: (file:///Users/katelovett/github/packages/packages/material_ui/lib/src/reorderable_list.dart:84:7)
warning: unresolved doc reference [TargetPlatformVariant.desktop]
from reorderable_list.ReorderableListView: (file:///Users/katelovett/github/packages/packages/material_ui/lib/src/reorderable_list.dart:84:7)
warning: internal dartdoc error: Unable to find library for element TargetPlatformVariant.mobile()
from reorderable_list.ReorderableListView: (file:///Users/katelovett/github/packages/packages/material_ui/lib/src/reorderable_list.dart:84:7)
warning: unresolved doc reference [TargetPlatformVariant.mobile]
from reorderable_list.ReorderableListView: (file:///Users/katelovett/github/packages/packages/material_ui/lib/src/reorderable_list.dart:84:7)
warning: internal dartdoc error: Unable to find library for element AsyncMatcher matchesGoldenFile(Object key, {int? version})
from material_ui.debugDisableShadows: (file:///Users/katelovett/github/flutter/packages/flutter/lib/src/painting/debug.dart:40:6)
warning: unresolved doc reference [matchesGoldenFile]
from material_ui.debugDisableShadows: (file:///Users/katelovett/github/flutter/packages/flutter/lib/src/painting/debug.dart:40:6)
in documentation inherited from material_ui.debugDisableShadows: (file:///Users/katelovett/github/flutter/packages/flutter/lib/src/painting/debug.dart:40:6)
warning: internal dartdoc error: Unable to find library for element class AutomatedTestWidgetsFlutterBinding extends TestWidgetsFlutterBinding
from material_ui.debugDisableShadows: (file:///Users/katelovett/github/flutter/packages/flutter/lib/src/painting/debug.dart:40:6)
warning: unresolved doc reference [AutomatedTestWidgetsFlutterBinding]
from material_ui.debugDisableShadows: (file:///Users/katelovett/github/flutter/packages/flutter/lib/src/painting/debug.dart:40:6)
in documentation inherited from material_ui.debugDisableShadows: (file:///Users/katelovett/github/flutter/packages/flutter/lib/src/painting/debug.dart:40:6)
warning: unresolved doc reference [TargetPlatformVariant.mobile]
from paginated_data_table.PaginatedDataTable.primary: (file:///Users/katelovett/github/packages/packages/material_ui/lib/src/paginated_data_table.dart:331:15)
in documentation inherited from paginated_data_table.PaginatedDataTable.primary: (file:///Users/katelovett/github/packages/packages/material_ui/lib/src/paginated_data_table.dart:331:15)
warning: unresolved doc reference [TargetPlatformVariant.mobile]
from reorderable_list.ReorderableListView.primary: (file:///Users/katelovett/github/packages/packages/material_ui/lib/src/reorderable_list.dart:328:15)
in documentation inherited from reorderable_list.ReorderableListView.primary: (file:///Users/katelovett/github/packages/packages/material_ui/lib/src/reorderable_list.dart:328:15)
Found 10 warnings and 0 errors.
@jakemac53 noticed too that "it is using dart pub get instead of flutter pub get for some reason", not sure if that is contributing
Activity
[cupertino_ui, material_ui] Fix bad doc references (#12381)
[-]Static analysis and dart doc issues on pub cannot be reproduced locally[/-][+]Support running analysis and dart doc locally as done on pub[/+]sigurdm commentedon Aug 11, 2026
After dart-lang/pana#1619 this should work as:
Piinks commentedon Aug 11, 2026
Wow thank you! Very cool!