Files
GetStuffDone/lib/models/todo.dart
2023-11-08 12:31:42 +01:00

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;
}