class ToDo { String title; String? description; DateTime deadline; String priority; // High, Medium, Low bool isCompleted; ToDo({ required this.title, required this.description, required this.deadline, required this.priority, this.isCompleted = false, }); Map toJson() { return { 'title': title, 'description': description, 'deadline': deadline.toIso8601String(), 'priority': priority, 'isCompleted': isCompleted, }; } static ToDo fromJson(Map json) { return ToDo( title: json['title'], description: json['description'], deadline: DateTime.parse(json['deadline']), priority: json['priority'], isCompleted: json['isCompleted'], ); } }