Visual Studio代码-URI的目标不存在"package:flutter/material.dart" [英] Visual Studio Code - Target of URI doesn't exist 'package:flutter/material.dart'
问题描述
我刚刚为Macbook进行了颤振开发,
I've just setup my Macbook for flutter development,
因此,我下载了flutter sdk,并将其放在我的文档中.之后,我将路径变量设置为在命令行中与 flutter 一起使用.
So I downloaded flutter sdk, and placed it in my Documents. After, I setup my path variable to work with flutter in my command line.
我执行命令flutter create todolist
,所以我实现了一个空白项目.
I execute the command flutter create todolist
so I achieve a blank project.
我还使用 Dart-Code 设置了我的Visual Studio代码,因此我具有正确的语法突出显示,智能感知等.
I also setup my visual studio code with Dart-Code so I have the proper syntax highlight, intellisense, etc.
因此,当我打开Visual Studio代码时,它会突出显示import
方法,如下图所示:
So when I open visual studio code, it highlights the import
method, like the following image:
这意味着它还突出显示了正确的类,这使得完全难以理解它是否是真正的错误.
This means that it also highlights the classes that are correct, making it completely hard to understand if its a real error or not.
我同时执行了pub get
和flutter packages get
并正确获取了所有内容.
我的路径变量全部正确.
I have executed both pub get
and flutter packages get
and got everything correctly.
I have my path variables all correctly.
为什么突出显示找不到导入"程序包?
Why is it highlighting it cannot find that 'import' package?
推荐答案
在
flutter packages get
为我解决了错误消息.
这篇关于Visual Studio代码-URI的目标不存在"package:flutter/material.dart"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!