Flutter Dependency error
how to add Sqflite dependency in flutter?
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.0
sqflite: any
english_words: "^3.1.0"
This is the correct way of doing it. Try running packages get (again).
You can specify versions with either the exact version sqflite: ^0.8.9, a range sqflite: >=0.8.0 <0.9.9 or just sqflite: any, which will always get you the latest version.
There is an in-depth guide on this topic available.
Just add:
sqflite: ^0.11.0(Latest version till date)
To the pubspec.yaml file.
Tap on packages get and your dependency will be added.
If you want to add the latest version of sqflite just leave it blank, like so:
sqflite:
This will always find the latest version of sqflite. Make sure you run:
flutter packages get
from your terminal.
Sometimes my dependencies take a while to add to the project. If you can't import the package in your code, try closing down your editor. When you open it back up it should add the new dependencies with no issues.
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.0
sqflite: any
english_words: "^3.1.0"
This is the correct way of doing it. Try running packages get (again).
You can specify versions with either the exact version sqflite: ^0.8.9, a range sqflite: >=0.8.0 <0.9.9 or just sqflite: any, which will always get you the latest version.
There is an in-depth guide on this topic available.
Just add:
sqflite: ^0.11.0(Latest version till date)
To the pubspec.yaml file.
Tap on packages get and your dependency will be added.
If you want to add the latest version of sqflite just leave it blank, like so:
sqflite:
This will always find the latest version of sqflite. Make sure you run:
flutter packages get
from your terminal.
Sometimes my dependencies take a while to add to the project. If you can't import the package in your code, try closing down your editor. When you open it back up it should add the new dependencies with no issues.
Comments
Post a Comment