24 lines
436 B
Dart
24 lines
436 B
Dart
import 'package:isar/isar.dart';
|
|
|
|
import '../services/dbhelper.dart';
|
|
|
|
part 'todo.g.dart';
|
|
|
|
@collection
|
|
class Todo {
|
|
final int id;
|
|
String title;
|
|
String description;
|
|
final DateTime createdAt;
|
|
bool done;
|
|
|
|
Todo({
|
|
int? index,
|
|
required this.title,
|
|
this.description = '',
|
|
DateTime? createdTime,
|
|
this.done = false,
|
|
}) : createdAt = createdTime ?? DateTime.now(),
|
|
id = index ?? DbHelper.nextTodoId;
|
|
}
|