implemented way to add todo
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user