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.
Related
i have an error in initState importing doesnt package doesnt work
error in flutter native splash
Did you imported the package using import at the top? if so then check the version compatibility of package with your flutter version. If you've just added this package, try flutter clean and flutter pub get.
There is no Show() method on Flutter Native Splash. I advice reading the instructions on how to use the package.
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.
My flutter has suddenly started giving me this error on assets_audio_player : "Undefined class 'AssetsAudioPlayer'.". The import for the player: import 'package:assets_audio_player/assets_audio_player.dart'; is also greyed out. I've tried upgrading the flutter & restarting the device but the issue is still there. Any clue what might've gone wrong? Thank you!
Before importing the package in your code, did you properly add its dependency in your "pubspec.yaml" file and then run the flutter pub get command?
I am guessing you're using this package.
Be sure to add a line like this to your package's pubspec.yaml (and run an implicit flutter pub get).
dependencies:
assets_audio_player: ^3.0.4+1
I cannot use my import 'package:google_sign_in/google_sign_in.dart'; although I installed it and restart my pc and run flutter pub get.
First
flutter clean
And then
flutter pub get
This should solve your problem .
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.