我正在学习 udemy 课程的教程,最近我构建了一台新电脑,因此存储我的代码的硬盘现在是次要的。当我编译代码时,它给了我以下错误。为了更好地解释它,我在我的代码中张贴了一个警告的图片,但我很确定这是一个错误,因为它通常与导入一样。代码错误 我尝试通过从 cmd 制作默认应用程序来运行测试应用程序,并且工作正常。所以很明显,flutter doctor 没有显示错误。错误是重复的,而且很长,所以我在下面粘贴了一些。
错误-
Invalid depfile: D:\WorkSpace\Code\Flutter\Image App\image_app\.dart_tool\flutter_build\8f0d0eee9ef614ed024ca7691a333af8\kernel_snapshot.d
Invalid depfile: D:\WorkSpace\Code\Flutter\Image App\image_app\.dart_tool\flutter_build\8f0d0eee9ef614ed024ca7691a333af8\kernel_snapshot.d
Compiler message:
Error: Could not resolve the package 'http' in 'package:http/http.dart'.
lib/src/app.dart:5:8: Error: Expected ';' after this.
import 'widgets/image_list.dart;'
^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/src/app.dart:2:8: Error: Not found: 'package:http/http.dart'
import 'package:http/http.dart' show get; //Only need get so we only care about one Get fuction
^
lib/src/app.dart:5:8: Error: Error when reading 'lib/src/widgets/image_list.dart;': The system cannot find the file specified.
import 'widgets/image_list.dart;'
^
/C:/src/flutter/packages/flutter/lib/src/material/bottom_navigation_bar.dart:9:8: Error: Error when reading …Run Code Online (Sandbox Code Playgroud)