static Database? _db;
if (_db != null) {
return;
}
try {
String _path = await getDatabasesPath() + 'users.db';
_db =
await openDatabase(_path, version: _version, onCreate: (db, version) {
print("Database oluşturuldu");
});
} catch (e) {
print(e);
}
}
static Future<List<Map<String, dynamic>>> query() async {
print("query");
return await _db!.query(_tableName);
}
I get the error Null check operator used on a null value even though I made the _db value nullable.
Appreciate if someone can advise. Thank you in advance!