4

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"
2
  • What is the error message? What is the output of flutter doctor? Commented May 3, 2018 at 10:59
  • Try sqflite: ^0.8.9 Commented May 3, 2018 at 11:00

3 Answers 3

3

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.

Sign up to request clarification or add additional context in comments.

1 Comment

always give me error missing semi colon I think there may be spacing issue ..please verify..and sorry for my bad English ..I hope you got my point..
0

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.

Comments

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.