feat: Implement permanent deletion and restoration of notes with updated UI

This commit is contained in:
2026-05-19 11:40:01 +02:00
parent 2a898111fa
commit f550476177
7 changed files with 236 additions and 132 deletions
+12 -9
View File
@@ -93,18 +93,21 @@ class _NoteEditorScreenState extends State<NoteEditorScreen> {
}
void _deleteNote() {
final bool isDeletedNote = _currentNote.isDeleted;
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
backgroundColor: const Color(0xFF303134),
title: const Text(
'Eliminar nota',
style: TextStyle(color: Colors.white),
title: Text(
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar nota',
style: const TextStyle(color: Colors.white),
),
content: const Text(
'¿Estás seguro de que deseas eliminar esta nota?',
style: TextStyle(color: Colors.white70),
content: Text(
isDeletedNote
? 'Esta nota ya está borrada. Si la eliminas ahora, se borrará permanentemente.'
: '¿Estás seguro de que deseas eliminar esta nota?',
style: const TextStyle(color: Colors.white70),
),
actions: [
TextButton(
@@ -119,9 +122,9 @@ class _NoteEditorScreenState extends State<NoteEditorScreen> {
Navigator.of(context).pop();
Navigator.of(context).pop('delete');
},
child: const Text(
'Eliminar',
style: TextStyle(color: Colors.red),
child: Text(
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar',
style: const TextStyle(color: Colors.red),
),
),
],