added checkbox to toggle if task is completed

This commit is contained in:
2026-06-15 16:10:03 +02:00
parent a422edaa38
commit 5130d27529
+7 -1
View File
@@ -40,7 +40,13 @@ class _TaskOverviewPageState extends State<TaskOverviewPage> {
return ListTile(
key: Key(task.id),
title: Text(task.title),
subtitle: Text(task.description),
subtitle: task.description.isNotEmpty ? Text(task.description) : null,
trailing: Checkbox(
value: task.isCompleted,
onChanged: (isCompleted) => context
.controller<TaskController>()
.saveTask(task.copyWith(isCompleted: isCompleted)),
),
onTap: () async {
final result = await onTaskTapped(task);
if (result != null && context.mounted) {