Hello Guys How are you all? Hope You all are fine. When I was trying to run my flutter app and suddenly I get the following error in my stack track. The target of URI doesn’t exist ‘package:flutter/material.dart’ in Visual Studio Code flutter. So today Here I come with all possible solutions for this error.
We are providing you all possible solutions to solve this error. let’s start this article without wasting your time.
How Target of URI doesn’t exist ‘package:flutter/material.dart’ in Visual Studio Code Error Occurs ?
When I run my flutter app in my Visual Studio code I got Target of URI doesn’t exist ‘package: flutter/material.dart’ error in my stack track. So probably Vs code studio, cant recognize Or cant find material. dart.
How to Solve Target of URI doesn’t exist ‘package:flutter/material.dart’ Error?
- How to Solve Target of URI doesn't exist 'package:flutter/material.dart' Error?
to Solve Target of URI doesn't exist 'package:flutter/material.dart' Error This problem has happened for several reasons. You have created a project and then you try to push the code to Git while your VS code is open. Or you are not run flutter packages get. I think You have to get all packages. That's why you are facing this issue. Just open the terminal from the project directory and run.
- Target of URI doesn't exist 'package:flutter/material.dart'
to Solve Target of URI doesn't exist 'package:flutter/material.dart' Error This problem has happened for several reasons. You have created a project and then you try to push the code to Git while your VS code is open. Or you are not run flutter packages get. I think You have to get all packages. That's why you are facing this issue. Just open the terminal from the project directory and run.
Solution 1
I think You have to get all packages. That’s why you are facing this issue. Just open the terminal from the project directory and run.
flutter packages get
Boom! Your Error must be solved.
Solution 2
This problem has happened for several reasons. You have created a project and then you try to push the code to Git while your VS code is open. Or you
- Just press Ctrl + Shift + A (Find Action).
- Search for “Dart Analysis”.
- Click the icon that says “Restart the Dart Analysis server”
- Now, Your red underline disappears from the package import, and everything works.
Summery
So, It’s All About This Error. I hope this tutorial helps you to solve your error. Please Comment Below if You stucks anywhere with my code.
Also Check Out Below Tutorials
- How to open a web browser (URL) from Flutter code?
- How to solve Flutter could not find tools.jar?
- Flutter Error : No Firebase App ‘[DEFAULT]’ has been created – call Firebase.initializeApp() in Flutter and Firebase
- Flutter: Unhandled Exception: ServicesBinding.defaultBinaryMessenger was accessed before the binding was initialized
- How to change package name in flutter?
Leave a Reply