close

[Solved] Target of URI doesn’t exist ‘package:flutter/material.dart’ in Visual Studio Code

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?

  1. 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.

  2. 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

  1. Just press Ctrl + Shift + A (Find Action).
  2. Search for “Dart Analysis”.
  3. Click the icon that says “Restart the Dart Analysis server”
  4. 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

Leave a Comment

%d bloggers like this: