feat: Update biometric screens to remove amber color from fingerprint icon for consistency

This commit is contained in:
2026-05-19 20:20:03 +02:00
parent 72afa7b5fe
commit 4912316845
3 changed files with 164 additions and 36 deletions
-1
View File
@@ -58,7 +58,6 @@ class BiometricChoiceScreen extends StatelessWidget {
children: [ children: [
const Icon( const Icon(
Icons.fingerprint, Icons.fingerprint,
color: Colors.amber,
size: 44, size: 44,
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
-1
View File
@@ -82,7 +82,6 @@ class _BiometricGateScreenState extends State<BiometricGateScreen> {
children: [ children: [
const Icon( const Icon(
Icons.fingerprint, Icons.fingerprint,
color: Colors.amber,
size: 44, size: 44,
), ),
const SizedBox(height: 16), const SizedBox(height: 16),
+138 -8
View File
@@ -65,7 +65,9 @@ class NoteEditorScreen extends StatefulWidget {
if (!completer.isCompleted) { if (!completer.isCompleted) {
completer.complete(result); completer.complete(result);
} }
if (entry.mounted) {
entry.remove(); entry.remove();
}
}, },
); );
}, },
@@ -146,11 +148,15 @@ class _NoteEditorScreenState extends State<NoteEditorScreen> {
_complete(updatedNote); _complete(updatedNote);
} }
void _deleteNote() { Future<bool> _showDeleteConfirmation() async {
final bool isDeletedNote = _currentNote.isDeleted; final bool isDeletedNote = _currentNote.isDeleted;
showDialog(
if (_isMobileLayout) {
final bool? confirmed = await showDialog<bool>(
context: context, context: context,
builder: (BuildContext context) { barrierDismissible: false,
barrierColor: Colors.transparent,
builder: (BuildContext dialogContext) {
return AlertDialog( return AlertDialog(
backgroundColor: const Color(0xFF303134), backgroundColor: const Color(0xFF303134),
title: Text( title: Text(
@@ -165,17 +171,14 @@ class _NoteEditorScreenState extends State<NoteEditorScreen> {
), ),
actions: [ actions: [
TextButton( TextButton(
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(dialogContext).pop(false),
child: const Text( child: const Text(
'Cancelar', 'Cancelar',
style: TextStyle(color: Colors.white70), style: TextStyle(color: Colors.white70),
), ),
), ),
TextButton( TextButton(
onPressed: () { onPressed: () => Navigator.of(dialogContext).pop(true),
Navigator.of(context).pop();
_complete('delete');
},
child: Text( child: Text(
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar', isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar',
style: const TextStyle(color: Colors.red), style: const TextStyle(color: Colors.red),
@@ -185,6 +188,133 @@ class _NoteEditorScreenState extends State<NoteEditorScreen> {
); );
}, },
); );
return confirmed ?? false;
}
final OverlayState? overlayState = Overlay.of(context, rootOverlay: true);
if (overlayState == null) {
final bool? confirmed = await showDialog<bool>(
context: context,
barrierDismissible: false,
barrierColor: Colors.transparent,
builder: (BuildContext dialogContext) {
return AlertDialog(
backgroundColor: const Color(0xFF303134),
title: Text(
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar nota',
style: const TextStyle(color: Colors.white),
),
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(
onPressed: () => Navigator.of(dialogContext).pop(false),
child: const Text(
'Cancelar',
style: TextStyle(color: Colors.white70),
),
),
TextButton(
onPressed: () => Navigator.of(dialogContext).pop(true),
child: Text(
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar',
style: const TextStyle(color: Colors.red),
),
),
],
);
},
);
return confirmed ?? false;
}
final Completer<bool> completer = Completer<bool>();
late final OverlayEntry entry;
bool didRemove = false;
void close(bool confirmed) {
if (!completer.isCompleted) {
completer.complete(confirmed);
}
if (!didRemove && entry.mounted) {
didRemove = true;
entry.remove();
}
}
entry = OverlayEntry(
builder: (BuildContext overlayContext) {
return Material(
color: Colors.transparent,
child: Stack(
children: [
const Positioned.fill(
child: ModalBarrier(
dismissible: false,
color: Color.fromARGB(140, 0, 0, 0),
),
),
Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 420),
child: AlertDialog(
backgroundColor: const Color(0xFF303134),
title: Text(
isDeletedNote
? 'Eliminar permanentemente'
: 'Eliminar nota',
style: const TextStyle(color: Colors.white),
),
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(
onPressed: () => close(false),
child: const Text(
'Cancelar',
style: TextStyle(color: Colors.white70),
),
),
TextButton(
onPressed: () => close(true),
child: Text(
isDeletedNote
? 'Eliminar permanentemente'
: 'Eliminar',
style: const TextStyle(color: Colors.red),
),
),
],
),
),
),
],
),
);
},
);
overlayState.insert(entry);
return completer.future;
}
Future<void> _deleteNote() async {
final bool confirmed = await _showDeleteConfirmation();
if (!mounted || !confirmed) {
return;
}
_complete('delete');
} }
String _formatDate(DateTime date) { String _formatDate(DateTime date) {