class ToDoItem { String name; String description; DateTime dueDate; String status; ToDoItem({ required this.name, required this.description, required this.dueDate, this.status = 'Pending', }); // Convert ToDoItem to JSON format Map toJson() { return { 'name': name, 'description': description, 'dueDate': dueDate.toIso8601String(), 'status': status, }; } // Create ToDoItem from JSON format static ToDoItem fromJson(Map json) { return ToDoItem( name: json['name'], description: json['description'], dueDate: DateTime.parse(json['dueDate']), status: json['status'], ); } }