diff --git a/lib/messages.i18n.dart b/lib/messages.i18n.dart index 4bb3381..32dfd1b 100644 --- a/lib/messages.i18n.dart +++ b/lib/messages.i18n.dart @@ -707,6 +707,16 @@ class ChecklistsMessages { /// ``` String get moveFailed => """Failed to move item."""; + /// ```dart + /// "Item marked as done" + /// ``` + String get itemMarkedDone => """Item marked as done"""; + + /// ```dart + /// "Undo" + /// ``` + String get undo => """Undo"""; + /// ```dart /// "New list" /// ``` @@ -1574,6 +1584,8 @@ Please complete login in your browser.""", """checklists.removeItem""": """Remove item""", """checklists.moveItem""": """Move to list""", """checklists.moveFailed""": """Failed to move item.""", + """checklists.itemMarkedDone""": """Item marked as done""", + """checklists.undo""": """Undo""", """checklists.createList""": """New list""", """checklists.listName""": """List name""", """checklists.listDescription""": """Description (optional)""", diff --git a/lib/messages.i18n.yaml b/lib/messages.i18n.yaml index 503e5bf..4b826c2 100644 --- a/lib/messages.i18n.yaml +++ b/lib/messages.i18n.yaml @@ -129,6 +129,8 @@ checklists: removeItem: Remove item moveItem: Move to list moveFailed: Failed to move item. + itemMarkedDone: Item marked as done + undo: Undo createList: New list listName: List name listDescription: Description (optional) diff --git a/lib/messages_de.i18n.dart b/lib/messages_de.i18n.dart index c7a4a87..45035ac 100644 --- a/lib/messages_de.i18n.dart +++ b/lib/messages_de.i18n.dart @@ -713,6 +713,16 @@ class ChecklistsMessagesDe extends ChecklistsMessages { /// ``` String get moveFailed => """Eintrag konnte nicht verschoben werden."""; + /// ```dart + /// "Eintrag als erledigt markiert" + /// ``` + String get itemMarkedDone => """Eintrag als erledigt markiert"""; + + /// ```dart + /// "Rückgängig" + /// ``` + String get undo => """Rückgängig"""; + /// ```dart /// "Neue Liste" /// ``` @@ -1595,6 +1605,8 @@ Bitte melde dich in deinem Browser an.""", """checklists.removeItem""": """Eintrag entfernen""", """checklists.moveItem""": """In Liste verschieben""", """checklists.moveFailed""": """Eintrag konnte nicht verschoben werden.""", + """checklists.itemMarkedDone""": """Eintrag als erledigt markiert""", + """checklists.undo""": """Rückgängig""", """checklists.createList""": """Neue Liste""", """checklists.listName""": """Listenname""", """checklists.listDescription""": """Beschreibung (optional)""", diff --git a/lib/messages_de.i18n.yaml b/lib/messages_de.i18n.yaml index efc9301..915efc9 100644 --- a/lib/messages_de.i18n.yaml +++ b/lib/messages_de.i18n.yaml @@ -129,6 +129,8 @@ checklists: removeItem: Eintrag entfernen moveItem: In Liste verschieben moveFailed: Eintrag konnte nicht verschoben werden. + itemMarkedDone: Eintrag als erledigt markiert + undo: "Rückgängig" createList: Neue Liste listName: Listenname listDescription: Beschreibung (optional) diff --git a/lib/messages_es.i18n.dart b/lib/messages_es.i18n.dart index d172fb1..db0c920 100644 --- a/lib/messages_es.i18n.dart +++ b/lib/messages_es.i18n.dart @@ -711,6 +711,16 @@ class ChecklistsMessagesEs extends ChecklistsMessages { /// ``` String get moveFailed => """No se pudo mover el artículo."""; + /// ```dart + /// "Artículo marcado como hecho" + /// ``` + String get itemMarkedDone => """Artículo marcado como hecho"""; + + /// ```dart + /// "Deshacer" + /// ``` + String get undo => """Deshacer"""; + /// ```dart /// "Nueva lista" /// ``` @@ -1587,6 +1597,8 @@ Por favor, completa el inicio de sesión en tu navegador.""", """checklists.removeItem""": """Eliminar artículo""", """checklists.moveItem""": """Mover a lista""", """checklists.moveFailed""": """No se pudo mover el artículo.""", + """checklists.itemMarkedDone""": """Artículo marcado como hecho""", + """checklists.undo""": """Deshacer""", """checklists.createList""": """Nueva lista""", """checklists.listName""": """Nombre de la lista""", """checklists.listDescription""": """Descripción (opcional)""", diff --git a/lib/messages_es.i18n.yaml b/lib/messages_es.i18n.yaml index 8ba1de9..b525316 100644 --- a/lib/messages_es.i18n.yaml +++ b/lib/messages_es.i18n.yaml @@ -129,6 +129,8 @@ checklists: removeItem: "Eliminar artículo" moveItem: Mover a lista moveFailed: "No se pudo mover el artículo." + itemMarkedDone: "Artículo marcado como hecho" + undo: Deshacer createList: Nueva lista listName: Nombre de la lista listDescription: "Descripción (opcional)" diff --git a/lib/messages_fr.i18n.dart b/lib/messages_fr.i18n.dart index a5bb62c..65aa4a4 100644 --- a/lib/messages_fr.i18n.dart +++ b/lib/messages_fr.i18n.dart @@ -714,6 +714,16 @@ class ChecklistsMessagesFr extends ChecklistsMessages { /// ``` String get moveFailed => """Impossible de déplacer l'article."""; + /// ```dart + /// "Article marqué comme fait" + /// ``` + String get itemMarkedDone => """Article marqué comme fait"""; + + /// ```dart + /// "Annuler" + /// ``` + String get undo => """Annuler"""; + /// ```dart /// "Nouvelle liste" /// ``` @@ -1592,6 +1602,8 @@ Veuillez terminer la connexion dans votre navigateur.""", """checklists.removeItem""": """Supprimer l'article""", """checklists.moveItem""": """Déplacer vers une liste""", """checklists.moveFailed""": """Impossible de déplacer l'article.""", + """checklists.itemMarkedDone""": """Article marqué comme fait""", + """checklists.undo""": """Annuler""", """checklists.createList""": """Nouvelle liste""", """checklists.listName""": """Nom de la liste""", """checklists.listDescription""": """Description (facultatif)""", diff --git a/lib/messages_fr.i18n.yaml b/lib/messages_fr.i18n.yaml index 63cba48..a72d3cc 100644 --- a/lib/messages_fr.i18n.yaml +++ b/lib/messages_fr.i18n.yaml @@ -129,6 +129,8 @@ checklists: removeItem: Supprimer l'article moveItem: "Déplacer vers une liste" moveFailed: "Impossible de déplacer l'article." + itemMarkedDone: "Article marqué comme fait" + undo: Annuler createList: Nouvelle liste listName: Nom de la liste listDescription: Description (facultatif) diff --git a/lib/messages_he.i18n.dart b/lib/messages_he.i18n.dart index 5e62b35..bbf6036 100644 --- a/lib/messages_he.i18n.dart +++ b/lib/messages_he.i18n.dart @@ -708,6 +708,16 @@ class ChecklistsMessagesHe extends ChecklistsMessages { /// ``` String get moveFailed => """העברת הפריט נכשלה."""; + /// ```dart + /// "הפריט סומן כהושלם" + /// ``` + String get itemMarkedDone => """הפריט סומן כהושלם"""; + + /// ```dart + /// "בטל" + /// ``` + String get undo => """בטל"""; + /// ```dart /// "רשימה חדשה" /// ``` @@ -1573,6 +1583,8 @@ Map get messagesHeMap => { """checklists.removeItem""": """הסר פריט""", """checklists.moveItem""": """העבר לרשימה""", """checklists.moveFailed""": """העברת הפריט נכשלה.""", + """checklists.itemMarkedDone""": """הפריט סומן כהושלם""", + """checklists.undo""": """בטל""", """checklists.createList""": """רשימה חדשה""", """checklists.listName""": """שם הרשימה""", """checklists.listDescription""": """תיאור (אופציונלי)""", diff --git a/lib/messages_he.i18n.yaml b/lib/messages_he.i18n.yaml index 4344442..3b53677 100644 --- a/lib/messages_he.i18n.yaml +++ b/lib/messages_he.i18n.yaml @@ -129,6 +129,8 @@ checklists: removeItem: הסר פריט moveItem: העבר לרשימה moveFailed: העברת הפריט נכשלה. + itemMarkedDone: הפריט סומן כהושלם + undo: בטל createList: רשימה חדשה listName: שם הרשימה listDescription: תיאור (אופציונלי) diff --git a/lib/views/checklists/checklists_view.dart b/lib/views/checklists/checklists_view.dart index 774ab52..63da8c7 100644 --- a/lib/views/checklists/checklists_view.dart +++ b/lib/views/checklists/checklists_view.dart @@ -525,6 +525,34 @@ class _ReorderablePartition extends StatelessWidget { this.categorySpacing = 'disabled', }); + void _toggleItem( + BuildContext context, + ChecklistsController controller, + ListItem item, + ) { + final wasDone = item.done; + controller.toggleItem(item); + if (wasDone) return; + + final messenger = ScaffoldMessenger.of(context); + messenger.clearSnackBars(); + messenger.showSnackBar( + SnackBar( + content: Text(m.checklists.itemMarkedDone), + action: SnackBarAction( + label: m.checklists.undo, + onPressed: () { + final current = controller.items.firstWhere( + (i) => i.id == item.id, + orElse: () => item.copyWith(done: true), + ); + if (current.done) controller.toggleItem(current); + }, + ), + ), + ); + } + void _viewItem( BuildContext context, ChecklistsController controller, @@ -684,7 +712,7 @@ class _ReorderablePartition extends StatelessWidget { ? controller.categories[item.categoryId] : null, houseId: controller.houseId, - onToggle: controller.toggleItem, + onToggle: (item) => _toggleItem(context, controller, item), onView: (item) => _viewItem(context, controller, item), onEdit: (item) => _editItem(context, controller, item), onMove: (item) => _moveItem(context, controller, item),