Search code examples
flutterflutter-dependenciesimporterrorimagepickerflutter-packages

Could not resolve image_picker package import | Flutter


Here is my 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

I am not able to import image_picker.dart and so I can't use it's function.

I have run flutter pub get command.

What could be the problem?


Solution

  • change your pubspec.yaml to this

    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
    

    let me know if this work.