[英]The following packages don't support null safety
How to run with the null safety using the following packages如何使用以下包以空安全运行
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.