我是flutter.io的新手,并根据以下指南尝试创建我的第一个flutter应用程序
我使用终端命令flutter run
启动我的应用程序,然后发现如下错误。
Your application could not be compiled, because its dependencies could not be established.
The following Dart file:
./startup_namer/lib/main.dart
...refers, in an import, to the following library:
/opt/flutter/packages/flutter/lib/meterial.dart
Unfortunately, that library does not appear to exist on your file system.
找不到有关如何解决此问题的更多详细信息。我要求在安装程序中安装此库软件包。从终端安装flutter库软件包的最简单方法是什么?
注意:我使用命令flutter create startup_namer
答案 0 :(得分:2)
根据错误消息判断,您在导入语句m e terial.dart
中拼写错误应该是:
import 'package:flutter/material.dart';
注意:如果使用“ import'package:myapp / settings.dart';”更改pubspec.yaml文件中的变量“ name:myapp”,则可能会遇到相同的错误。作为main.dart文件中的自定义包,旨在将“ comanyName”文本添加到应用启动器图标。修复:更改回“名称:myapp”消除了错误