feat: Update dialog styles and background colors for consistency across screens
This commit is contained in:
@@ -430,6 +430,11 @@ class _NotesAppState extends State<NotesApp>
|
|||||||
final bool? retry = await showDialog<bool>(
|
final bool? retry = await showDialog<bool>(
|
||||||
context: dialogCtx,
|
context: dialogCtx,
|
||||||
builder: (BuildContext context) => AlertDialog(
|
builder: (BuildContext context) => AlertDialog(
|
||||||
|
backgroundColor: AppColors.cardBackground,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
side: BorderSide(color: AppColors.border),
|
||||||
|
),
|
||||||
title: const Text('No se pudo activar la biometría'),
|
title: const Text('No se pudo activar la biometría'),
|
||||||
content: const Text(
|
content: const Text(
|
||||||
'No se pudo activar la biometría. ¿Quieres intentarlo de nuevo o entrar sin huella?',
|
'No se pudo activar la biometría. ¿Quieres intentarlo de nuevo o entrar sin huella?',
|
||||||
|
|||||||
@@ -935,6 +935,11 @@ class _CategoryDialogState extends State<_CategoryDialog> {
|
|||||||
final bool? confirm = await showDialog<bool>(
|
final bool? confirm = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) => AlertDialog(
|
builder: (BuildContext context) => AlertDialog(
|
||||||
|
backgroundColor: AppColors.cardBackground,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
side: BorderSide(color: AppColors.border),
|
||||||
|
),
|
||||||
title: const Text('Borrar categoría'),
|
title: const Text('Borrar categoría'),
|
||||||
content: const Text('¿Seguro que quieres borrar esta categoría?'),
|
content: const Text('¿Seguro que quieres borrar esta categoría?'),
|
||||||
actions: [
|
actions: [
|
||||||
@@ -943,6 +948,7 @@ class _CategoryDialogState extends State<_CategoryDialog> {
|
|||||||
child: const Text('Cancelar'),
|
child: const Text('Cancelar'),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
|
style: TextButton.styleFrom(foregroundColor: AppColors.destructive),
|
||||||
onPressed: () => Navigator.pop(context, true),
|
onPressed: () => Navigator.pop(context, true),
|
||||||
child: const Text('Borrar'),
|
child: const Text('Borrar'),
|
||||||
),
|
),
|
||||||
@@ -957,12 +963,14 @@ class _CategoryDialogState extends State<_CategoryDialog> {
|
|||||||
try {
|
try {
|
||||||
await widget.repository.deleteCategory(widget.category!.id);
|
await widget.repository.deleteCategory(widget.category!.id);
|
||||||
await widget.onCategoriesChanged();
|
await widget.onCategoriesChanged();
|
||||||
try {
|
// Notify parent to switch view to all notes when a category is deleted.
|
||||||
await widget.onRequestSync();
|
await widget.onCategoryDeleted();
|
||||||
} catch (_) {}
|
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
Navigator.pop(context);
|
Navigator.pop(context);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
await widget.onRequestSync();
|
||||||
|
} catch (_) {}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (mounted) {
|
if (mounted) {
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
@@ -975,6 +983,11 @@ class _CategoryDialogState extends State<_CategoryDialog> {
|
|||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
|
backgroundColor: AppColors.cardBackground,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
side: BorderSide(color: AppColors.border),
|
||||||
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
widget.category == null ? 'Crear categoría' : 'Editar categoría',
|
widget.category == null ? 'Crear categoría' : 'Editar categoría',
|
||||||
),
|
),
|
||||||
|
|||||||
@@ -202,7 +202,11 @@ class _NoteEditorScreenState extends State<NoteEditorScreen> {
|
|||||||
final bool isDeletedNote = _currentNote.isDeleted;
|
final bool isDeletedNote = _currentNote.isDeleted;
|
||||||
|
|
||||||
return AlertDialog(
|
return AlertDialog(
|
||||||
backgroundColor: AppColors.surfaceElevated,
|
backgroundColor: AppColors.cardBackground,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
side: BorderSide(color: AppColors.border),
|
||||||
|
),
|
||||||
title: Text(
|
title: Text(
|
||||||
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar nota',
|
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar nota',
|
||||||
style: const TextStyle(color: AppColors.textPrimary),
|
style: const TextStyle(color: AppColors.textPrimary),
|
||||||
|
|||||||
@@ -43,6 +43,11 @@ class _SettingsScreenState extends State<SettingsScreen> {
|
|||||||
final bool? confirmed = await showDialog<bool>(
|
final bool? confirmed = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
builder: (context) => AlertDialog(
|
||||||
|
backgroundColor: AppColors.cardBackground,
|
||||||
|
shape: RoundedRectangleBorder(
|
||||||
|
borderRadius: BorderRadius.circular(12),
|
||||||
|
side: BorderSide(color: AppColors.border),
|
||||||
|
),
|
||||||
title: const Text('Borrar todos los datos'),
|
title: const Text('Borrar todos los datos'),
|
||||||
content: const Text(
|
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.',
|
'¿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>(
|
final bool? confirmed = await showDialog<bool>(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (context) => AlertDialog(
|
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'),
|
title: const Text('Borrar toda la info del servidor'),
|
||||||
content: const Text(
|
content: const Text(
|
||||||
'¿Estás seguro? Esta acción eliminará toda la información almacenada en el servidor y no se puede deshacer.',
|
'¿Estás seguro? Esta acción eliminará toda la información almacenada en el servidor y no se puede deshacer.',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'package:flutter/material.dart';
|
|||||||
import 'package:notas/theme/app_colors.dart';
|
import 'package:notas/theme/app_colors.dart';
|
||||||
|
|
||||||
class AppTheme {
|
class AppTheme {
|
||||||
static ThemeData theme({Color seedColor = Colors.amber}) {
|
static ThemeData theme({Color seedColor = AppColors.defaultThemeSeedColor}) {
|
||||||
final Brightness foregroundBrightness =
|
final Brightness foregroundBrightness =
|
||||||
ThemeData.estimateBrightnessForColor(seedColor);
|
ThemeData.estimateBrightnessForColor(seedColor);
|
||||||
final Color foregroundColor = foregroundBrightness == Brightness.dark
|
final Color foregroundColor = foregroundBrightness == Brightness.dark
|
||||||
|
|||||||
Reference in New Issue
Block a user