// todo_item.dart
class ToDoItem {
 String title;
 bool isDone;
 String priority; // "高", "中", "低"
 
 ToDoItem({required this.title, this.isDone = false, this.priority = "中"});
}
// todo_item.dart
DateTime? reminder; // 任務提醒時間
ToDoItem({required this.title, this.isDone = false, this.priority = "中", this.reminder});
// todo_item_widget.dart
Widget build(BuildContext context) {
return ListTile(
title: Text(item.title),
leading: Icon(
Icons.label,
color: item.priority == "高" ? Colors.red : item.priority == "中" ? Colors.orange : Colors.green,
),
trailing: item.reminder != null
? Icon(Icons.notifications_active, color: Colors.blue)
: null,
onTap: () {
setState(() { item.isDone = !item.isDone; });
},
);
}
```
 