i have the same problem till now
insertToDatabase({
required String title,
required String time,
required String date,
}) async {
await database?.transaction((txn) {
txn
.rawInsert(
'INSERT INTO tasks (title , date , time , status) VALUES ("$title $time" , "$date" , "new")')
.then((value) {
print('$value inserted successfully');
emit(AppInsertDatabaseState());
getDataFromDatabase(database);
}).catchError((error) {
print('Error When Inserting new Records ${error.toString()}');
});
//throw Exception('Result unexpectedly null');
print(null!);
https://stackoverflow.com/a/54097327/3596519 – Masoud Jan 16 '22 at 09:36