颤振依赖性错误

时间:2018-05-03 10:55:33

标签: flutter

如何在flutter中添加Sqflite依赖项?

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"

3 个答案:

答案 0 :(得分:1)

这是正确的做法。尝试再次运行packages get

您可以使用确切的版本sqflite: ^0.8.9,范围sqflite: >=0.8.0 <0.9.9sqflite: any来指定版本,这将始终为您提供最新版本。

有一个深入的guide on this topic可用。

答案 1 :(得分:0)

只需添加:

sqflite: ^0.11.0(Latest version till date)

到pubspec.yaml文件。 点击获取包,您的依赖项将被添加。

答案 2 :(得分:0)

如果要添加最新版本的sqflite,请将其留空,如下所示:

  sqflite:

这将始终找到最新版本的sqflite。确保您运行:

flutter packages get

从您的终端。

有时我的依赖项需要一段时间才能添加到项目中。如果无法在代码中导入包,请尝试关闭编辑器。当您打开它进行备份时,应该没有问题地添加新的依赖项。

相关问题