Skip to content

Commit 10e542a

Browse files
bug fix
1 parent 46a596b commit 10e542a

File tree

1 file changed

+19
-11
lines changed

1 file changed

+19
-11
lines changed

lib/widgets/buildTasks.dart

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -80,18 +80,26 @@ class _TasksBuilderState extends State<TasksBuilder> {
8080

8181
// Show a snackbar with an undo action
8282
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
83-
content: Text(
84-
'Task Updated',
85-
style: TextStyle(
86-
color: AppSettings.isDarkMode
87-
? TaskWarriorColors.kprimaryTextColor
88-
: TaskWarriorColors.kLightPrimaryTextColor,
89-
),
83+
content: Text(
84+
'Task Updated',
85+
style: TextStyle(
86+
color: AppSettings.isDarkMode
87+
? TaskWarriorColors.kprimaryTextColor
88+
: TaskWarriorColors.kLightPrimaryTextColor,
9089
),
91-
backgroundColor: AppSettings.isDarkMode
92-
? TaskWarriorColors.ksecondaryBackgroundColor
93-
: TaskWarriorColors.kLightSecondaryBackgroundColor,
94-
duration: const Duration(seconds: 2)));
90+
),
91+
backgroundColor: AppSettings.isDarkMode
92+
? TaskWarriorColors.ksecondaryBackgroundColor
93+
: TaskWarriorColors.kLightSecondaryBackgroundColor,
94+
duration: const Duration(seconds: 2),
95+
action: SnackBarAction(
96+
label: 'Undo',
97+
onPressed: () {
98+
// Undo the task status change
99+
undoChanges();
100+
},
101+
),
102+
));
95103
}
96104

97105
void undoChanges() {

0 commit comments

Comments
 (0)