I always get a new object inserted rather than updating a old object in the database which I observed using Isar Inspector.
Future<void> updateinvstatus(bool x) async {
final isar = await db;
final cflist = await isar.cfs.where().findAll();
final cf = cflist.last;
cf
..end = DateTime.now()
..status = x;
await isar.writeTxn(() async {
await isar.cfs.put(cf);
});
}
I would be grateful for suggestions. I'm a beginner in programming as a whole and flutter.