Not able to import the image_picker package | flutter - flutter

I am not able to use the image_picker package, VS marks it as an error "Target of the URI doesn't exist"

Stop project and do this flutter clean and flutter pub get and start it again.

Related

Image picker flutter issue

when I try to use image_picker and run the flutter project it gives me error
A problem occurred configuring project ':image_picker_android'.
Could not load compiled classes for build file 'C:\Users\ZerpSteve\Documents\flutter_windows_2.10.2-stable\flutter.pub-cache\hosted\pub.dartlang.org\image_picker_android-0.8.5\android\build.gradle' from cache.
Use this command in your flutter project folder and rerun your project.
flutter clean && flutter pub get

flutter pub get won't download dependency

I deleted a package manually from Dart Package directory and deleted pubspec.lock. Now when I do flutter pub get it does not download that package again. I tried flutter clean && flutter pub get but it's not working as well. Please help I can't build my project now.
You can try to close and then open the editor and try:
flutter clean
flutter packages get
flutter packages upgrade

Can't import font awesome flutter?

Im new to Flutter, i use Visual Studio Code with Flutter extension. I try to import the package "font awesome" but i got an error. I search on internet but nothing solve that.
Error
pubspec.yaml
Flutter pub get
Import package
If still not importing then restart IDE
hope this will work
If you run flutter pub add font_awesome_flutter or flutter pub get font_awesome_flutter and the import statement still shows an error, try running flutter pub upgrade font_awesome_flutter.

'flutter pub get' does not work in VSCode

I'm currently developing flutter application with VSCode and want to add some packages. ex) dropdown_menu
I did flutter pub get / flutter packages get / clicking down arrow button in vscode(get Packages)
and this is all I get everytime
PS D:\VSCodeProjects\testt> flutter pub get
Running "flutter pub get" in testt... 0.4s
PS D:\VSCodeProjects\testt>
this is my code in pubspec.
dependencies:
flutter:
sdk: flutter
cupertino_icons: ^0.1.3
dropdown_menu: ^1.1.0
I did turn on / off program( and computer) , restart,
and
flutter clean
flutter packages get
flutter packages upgrade
Does anybody know how to solve??
It's running, by default in vs code whenever you save your .yaml file it runs it under the hood. When you explicitly run it using the command, it takes very less time as the packages are already up to date.
If in doubt, try to use the new packages that you added and they should not give errors.
flutter pub get is meant to be quick especially when you don't have much libraries.
What you see is right there should not be any problem.
But if there is issues where you are going for a specific version and it is not working, this is because pubspec.yaml stores the settings of what version of library but pubspec.lock stores the actual version your app is using.
Judging from your comments of it not showing up. It might be related to this #31115
try the solution and see if it works.
Select the View > Command Palette menubar option
Type "flutter"
Click "flutter get packages"
you can use this in vscode
Pubspec Assist
After typing the package don't forget to save the yaml file or click ctrl + s.

Flutter provider installation error while running pub get

I am trying to install provider(flutter package) but getting an error message when trying to run $ pub get :
enter image description here
Provider Package installation error:
update your flutter sdk which is greater then 1.15.17, your current version of flutter SDK. then try to install the flutter package again..
The latest Stable release of flutter is v1.17.1 . So just update your flutter and then add the your desired flutter package..
you need to update your flutter sdk with the command 'flutter upgrade', and only then try to install the provider package again.
try to always keep updated