Short answer
Run flutter pub get in the folder that holds pubspec.yaml. Open that folder itself in the editor, not its parent. If the error stays, check the editor uses the Flutter SDK (in VS Code, Command Palette, Flutter: Change SDK) and run Dart: Restart Analysis Server. For package:flutter, pubspec.yaml must list flutter: sdk: flutter under dependencies.
Rather not fix it yourself? App Fix Ticket fixes one reproducible bug at a fixed price, with an optional Diagnosis that is credited toward the fix.
Why the analyzer can’t find the package, and the fix
01
The packages were never fetched
“To map packages back to the system cache, this command creates a package_config.json file in the .dart_tool/ directory.” Dart, dart pub get
A fresh clone, a branch switch or a new line in pubspec.yaml leaves .dart_tool/package_config.json missing or out of date. Without it, no package: import resolves. Fetch them from the project folder.
flutter pub get02
The editor opened the wrong folder
“Ensure that the folder that contains your pubspec.yaml is inside a VS Code Workspace Folder” Flutter, Visual Studio Code
Opening a parent folder, or a monorepo root, hides the project from the Flutter extension, and the status bar shows no Flutter version. Use File, Open Folder on the folder that contains pubspec.yaml.
03
The editor isn’t using the Flutter SDK
With only a standalone Dart SDK, or a stale path after moving Flutter, the analyzer has no flutter package to find. In VS Code run Flutter: Change SDK, or set dart.flutterSdkPath in settings.json, then Dart: Restart Analysis Server. In Android Studio, set the path under Settings, Languages & Frameworks, Flutter.
// .vscode/settings.json { "dart.flutterSdkPath": "/Users/you/develop/flutter" }04
pubspec.yaml doesn’t depend on Flutter, or the import is mistyped
“The analyzer produces this diagnostic when an import, export, or part directive is found where the URI refers to a file that doesn't exist.” Dart, uri_does_not_exist
A project made with dart create has no Flutter dependency. Add it, then run flutter pub get. For any other package, check the name matches pubspec.yaml exactly.
dependencies: flutter: sdk: flutter
Checked against the vendor’s docs on : Dart: dart pub get; Flutter: Visual Studio Code; Dart diagnostics: uri_does_not_exist.
Rather hand it over?
Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.
- from $450App Fix TicketOne reproducible bug. The Fix costs $1,200. If you need a Diagnosis first, its $450 fee counts toward the Fix.See scope and start
- from $450AI-Built App RescueFor a whole-app review, the $450 Launch Check is credited toward the optional $1,950 Rescue Sprint for up to five critical or high findings.No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.See scope and start
“Very responsive, attentive to fixing bugs, and completed the project as needed! Thank you!”
Related: flutter: command not found · Flutter pub “version solving failed” · Flutter “Unable to load asset” · Flutter “Unimplemented handling of missing static target”