24 lines
527 B
Dart
24 lines
527 B
Dart
class Task {
|
|
final String id;
|
|
String title;
|
|
String? description;
|
|
DateTime createdAt;
|
|
DateTime? dueDate;
|
|
bool isCompleted;
|
|
Priority priority;
|
|
String? category;
|
|
|
|
Task({
|
|
String? id,
|
|
required this.title,
|
|
this.description,
|
|
DateTime? createdAt,
|
|
this.dueDate,
|
|
this.isCompleted = false,
|
|
this.priority = Priority.medium,
|
|
this.category,
|
|
}) : id = id ?? DateTime.timestamp().microsecond.toString(),
|
|
createdAt = createdAt ?? DateTime.now();
|
|
}
|
|
|
|
enum Priority { low, medium, high } |