implemented way to add todo

This commit is contained in:
SomnusVeritas
2023-11-08 11:34:39 +01:00
parent d2f3eb109d
commit 15c404c962
5 changed files with 50 additions and 8 deletions

View File

@@ -1,5 +1,7 @@
import 'package:isar/isar.dart';
import '../services/dbhelper.dart';
part 'todo.g.dart';
@collection
@@ -10,9 +12,10 @@ class Todo {
final DateTime createdAt;
Todo({
required this.id,
int? id,
required this.title,
this.description = '',
DateTime? createdAt,
}) : createdAt = createdAt ?? DateTime.now();
}) : createdAt = createdAt ?? DateTime.now(),
id = id ?? DbHelper.nextTodoId;
}