Info
- Dart 3.11.0 (stable) (Mon Feb 9 00:38:07 2026 -0800) on "windows_x64"
- on windows / "Windows 11 家庭版" 10.0 (Build 26200)
- locale is zh-CN
Currently, when using pub workspace, the local package in pubspec.yaml references the local package in the workspace is written exactly the same as the dependency reference to the external pub.dev. This syntactic ambiguity can lead to the inability to visually distinguish between local dependencies and external dependencies.
pubspec.yaml for pub
# local
flutter_package_1:
flutter_package_1: any
flutter_package_1: ^0.0.1
# external
flutter_lints:
flutter_lints: any
flutter_lints: ^6.0.0
package.json for pnpm
Expected
Referring to pnpm workspace dependency syntax, I expect to introduce a similar explicit workspace dependency declaration for pubspec.yaml.
flutter_package_1: workspace
flutter_package_1: workspace:any
flutter_package_1: workspace:^0.0.1
# or
flutter_package_1:
workspace:
flutter_package_1:
workspace: any
flutter_package_1:
workspace: ^0.0.1
https://github.com/luo2430/dart_pub_issue_4790
The project directory is shown in the image below

Info
Currently, when using pub workspace, the local package in pubspec.yaml references the local package in the workspace is written exactly the same as the dependency reference to the external pub.dev. This syntactic ambiguity can lead to the inability to visually distinguish between local dependencies and external dependencies.
Expected
Referring to pnpm workspace dependency syntax, I expect to introduce a similar explicit workspace dependency declaration for pubspec.yaml.
https://github.com/luo2430/dart_pub_issue_4790
The project directory is shown in the image below