feat: Update dialog styles and background colors for consistency across screens
This commit is contained in:
@@ -935,6 +935,11 @@ class _CategoryDialogState extends State<_CategoryDialog> {
|
||||
final bool? confirm = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (BuildContext context) => AlertDialog(
|
||||
backgroundColor: AppColors.cardBackground,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side: BorderSide(color: AppColors.border),
|
||||
),
|
||||
title: const Text('Borrar categoría'),
|
||||
content: const Text('¿Seguro que quieres borrar esta categoría?'),
|
||||
actions: [
|
||||
@@ -943,6 +948,7 @@ class _CategoryDialogState extends State<_CategoryDialog> {
|
||||
child: const Text('Cancelar'),
|
||||
),
|
||||
TextButton(
|
||||
style: TextButton.styleFrom(foregroundColor: AppColors.destructive),
|
||||
onPressed: () => Navigator.pop(context, true),
|
||||
child: const Text('Borrar'),
|
||||
),
|
||||
@@ -957,12 +963,14 @@ class _CategoryDialogState extends State<_CategoryDialog> {
|
||||
try {
|
||||
await widget.repository.deleteCategory(widget.category!.id);
|
||||
await widget.onCategoriesChanged();
|
||||
try {
|
||||
await widget.onRequestSync();
|
||||
} catch (_) {}
|
||||
// Notify parent to switch view to all notes when a category is deleted.
|
||||
await widget.onCategoryDeleted();
|
||||
if (mounted) {
|
||||
Navigator.pop(context);
|
||||
}
|
||||
try {
|
||||
await widget.onRequestSync();
|
||||
} catch (_) {}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
@@ -975,6 +983,11 @@ class _CategoryDialogState extends State<_CategoryDialog> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AlertDialog(
|
||||
backgroundColor: AppColors.cardBackground,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side: BorderSide(color: AppColors.border),
|
||||
),
|
||||
title: Text(
|
||||
widget.category == null ? 'Crear categoría' : 'Editar categoría',
|
||||
),
|
||||
|
||||
@@ -202,7 +202,11 @@ class _NoteEditorScreenState extends State<NoteEditorScreen> {
|
||||
final bool isDeletedNote = _currentNote.isDeleted;
|
||||
|
||||
return AlertDialog(
|
||||
backgroundColor: AppColors.surfaceElevated,
|
||||
backgroundColor: AppColors.cardBackground,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side: BorderSide(color: AppColors.border),
|
||||
),
|
||||
title: Text(
|
||||
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar nota',
|
||||
style: const TextStyle(color: AppColors.textPrimary),
|
||||
|
||||
@@ -43,6 +43,11 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
final bool? confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
backgroundColor: AppColors.cardBackground,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side: BorderSide(color: AppColors.border),
|
||||
),
|
||||
title: const Text('Borrar todos los datos'),
|
||||
content: const Text(
|
||||
'¿Estás seguro? Esta acción eliminará la base de datos local y la clave de cifrado. Asegúrate de tener una copia de seguridad si es necesario o cuenta sincronizada.',
|
||||
@@ -96,6 +101,11 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
||||
final bool? confirmed = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (context) => AlertDialog(
|
||||
backgroundColor: AppColors.cardBackground,
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.circular(12),
|
||||
side: BorderSide(color: AppColors.border),
|
||||
),
|
||||
title: const Text('Borrar toda la info del servidor'),
|
||||
content: const Text(
|
||||
'¿Estás seguro? Esta acción eliminará toda la información almacenada en el servidor y no se puede deshacer.',
|
||||
|
||||
Reference in New Issue
Block a user