Files
task_hub/lib/models/task.dart
2026-04-26 14:23:32 +08:00

26 lines
535 B
Dart

class Task {
final int id;
String title;
String? desc;
DateTime? dueDate;
DateTime? scheduleDate;
bool isCompleted;
Priority priority;
String? category;
DateTime createTime;
Task({
int? id,
required this.title,
this.desc,
this.dueDate,
this.scheduleDate,
this.isCompleted = false,
this.priority = Priority.medium,
this.category,
DateTime? createTime,
}) : id = id ?? DateTime.timestamp().microsecond,
createTime = DateTime.now();
}
enum Priority { low, medium, high }