无法解析 image_picker 包导入 |扑

Could not resolve image_picker package import | Flutter

这是我的 pubspec.yaml

dependencies:
  flutter:
    sdk: flutter
  firebase_auth: ^1.0.1
  settings_ui: ^0.6.0
  custom_switch: 0.0.1
  firebase_core: ^1.0.2
  path_provider: ^2.0.1
  another_flushbar: ^1.10.17
  cloud_firestore: ^1.0.2
  image_picker: ^0.7.4
  cupertino_icons: ^1.0.2

profile.dart package import section

我无法导入 image_picker.dart,所以我无法使用它的功能。

我有 运行 flutter pub get 命令。

可能是什么问题?

你忘了添加这个^

 image_picker: ^0.7.4

把你的pubspec.yaml改成这个

dependencies:
  flutter:
    sdk: flutter
  firebase_auth: 
  settings_ui: ^0.6.0
  custom_switch: 0.0.1
  firebase_core: 
  path_provider: ^2.0.1
  another_flushbar: ^1.10.17
  cloud_firestore: 
  image_picker: 
  cupertino_icons: ^1.0.2

让我知道这是否有效。