Target of URI doesn't exist 'package:flutter/material.dart'
- ctrl -> Shift -> A (Find Action)
- Search for "Dart Analysis"
- Click the icon that says "Restart the Dart Analysis server"
- The red underline disappears from the package import and everything works.
I tried this solution and it worked just perfect:
open terminal from the project directoryand run
flutter packages get
Flutter Issue Fix: 18-April-2020
It happened due to :
- You have created a project and then you try to push the code to Git ( and keeping your vscode open)
- Your package needs to update using command flutter packages get ( simply from vscode menu choose terminal and then run this command )
- If you still it didn't fix your issue, simply go to File Menu, choose Close Folder, it fixes your issue.
- Last option restart VSCode.
Keep Coding #Flutter