Visual Studio代码 - 目标URI不存在

问题描述 投票:2回答:1

我正在尝试调试一个颤振项目。该程序抛出错误,因为widget_test.dart无法导入main.dart

我通常使用Intellij创建项目。这是我使用Visual Studio Code创建的第一个项目。

enter image description here

我无法清除此错误消息

Target of URI doesn't exist: 'package:ipl_test2/main.dart'.

这个错误的原因是什么?以及如何清除此错误?

visual-studio-code flutter
1个回答
1
投票

您必须使用与pubspec.yaml文件中描述的名称相同的名称,特别是name属性。

import 'package:change_the_name_here/main.dart';
© www.soinside.com 2019 - 2024. All rights reserved.