简体   繁体   English

以下包不支持空安全

[英]The following packages don't support null safety

How to run with the null safety using the following packages如何使用以下包以空安全运行

  • package:sqflite包:sqflite
  • package:sqflite_common包:sqflite_common
  • package:synchronized包:同步

Code:代码:

void database() async {
// ignore: unused_local_variable
var database = await openDatabase('alimaher.db', version: 1,
    onCreate: (database, vervion) {
  // ignore: avoid_print
  print('database created');
  database
      .execute(
          'CREATE TABLE tasks (id INTEGER PRIMARY KEY,title TEXT, date TEXT,time TEXT,status TEXT ) ')
      .then((value) {
    // ignore: avoid_print
    print('table created');
  }).catchError((error) {
    // ignore: avoid_print
    print('error when creating table ${error.toString()}');
  });
}, onOpen: (database) {
  // ignore: avoid_print
  print('database opened');
});

} }

The error message:错误信息:

Error: Cannot run with sound null safety, because the following dependencies don't support null safety:错误:无法以健全的空安全运行,因为以下依赖项不支持空安全:

  • package:sqflite包:sqflite
  • package:sqflite_common包:sqflite_common
  • package:synchronized包:同步

All three packages do support sound null-safety in their latest releases.所有三个包在其最新版本中支持声音空安全。

You did not show your pubspec.yaml, but I guess you will need to update those packages to their most recent versions.您没有显示 pubspec.yaml,但我想您需要将这些软件包更新到最新版本。

将软件包更新到最新版本或使用--no-sound-null-safety参数构建

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Flutter 2.0 以下依赖不支持 null 安全 - Flutter 2.0 following dependencies don't support null safety 无法以健全的 null 安全运行,因为以下依赖项不支持 null 安全 - Cannot run with sound null safety, because the following dependencies don't support null safety 错误:无法以健全的 null 安全运行,因为以下依赖项不支持 null 安全; 在 flutter - Error: Cannot run with sound null safety, because the following dependencies don't support null safety; in flutter Flutter 不能以空安全运行,因为以下依赖不支持空安全 - Flutter Cannot run with sound null safety, because the following dependencies don't support null safety "无法以可靠的 null 安全性运行,因为以下依赖项不支持 null 安全性:" - Cannot run with sound null safety, because the following dependencies don't support null safety: 错误:无法以健全的 null 安全运行,因为以下依赖项不支持 null 安全: - Error: Cannot run with sound null safety, because the following dependencies don't support null safety: 无法以声音 null 安全运行,因为依赖项不支持 null 安全 - Cannot run with sound null safety because dependencies don't support null safety 不升级旧包的不健全的空安全 - Unsound null safety without upgrading legacy packages 如何在 flutter 中混合使用 nullsafety 而不是 null 安全包 - How to mix nullsafety and not null safety packages in flutter 如何处理以下空安全? 不能无条件调用该函数,因为它可以为“空”。 尝试添加一个空检查 ('!') - How to handle the following null safety? The function can't be unconditionally invoked because it can be 'null'. Try adding a null check ('!')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM