Flutter 导入 import 'package:english_words/english_words.dart'报错

1,在项目根目录下打开 pubspec.yaml 文件,找到如下代码,添加高亮处代码

dependencies:
  flutter:
    sdk: flutter

  # The following adds the Cupertino Icons font to your application.
  # Use with the CupertinoIcons class for iOS style icons.
  cupertino_icons: ^0.1.2
  english_words: ^3.1.0


2,在 AS 命令行中执行 flutter packages get 即可

Flutter 导入 import 'package:english_words/english_words.dart'报错_第1张图片

你可能感兴趣的:(Flutter开发)