feat: Update biometric screens to remove amber color from fingerprint icon for consistency
This commit is contained in:
@@ -58,7 +58,6 @@ class BiometricChoiceScreen extends StatelessWidget {
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.fingerprint,
|
||||
color: Colors.amber,
|
||||
size: 44,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
@@ -82,7 +82,6 @@ class _BiometricGateScreenState extends State<BiometricGateScreen> {
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.fingerprint,
|
||||
color: Colors.amber,
|
||||
size: 44,
|
||||
),
|
||||
const SizedBox(height: 16),
|
||||
|
||||
@@ -65,7 +65,9 @@ class NoteEditorScreen extends StatefulWidget {
|
||||
if (!completer.isCompleted) {
|
||||
completer.complete(result);
|
||||
}
|
||||
entry.remove();
|
||||
if (entry.mounted) {
|
||||
entry.remove();
|
||||
}
|
||||
},
|
||||
);
|
||||
},
|
||||
@@ -146,45 +148,173 @@ class _NoteEditorScreenState extends State<NoteEditorScreen> {
|
||||
_complete(updatedNote);
|
||||
}
|
||||
|
||||
void _deleteNote() {
|
||||
Future<bool> _showDeleteConfirmation() async {
|
||||
final bool isDeletedNote = _currentNote.isDeleted;
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
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(context).pop(),
|
||||
child: const Text(
|
||||
'Cancelar',
|
||||
style: TextStyle(color: Colors.white70),
|
||||
),
|
||||
|
||||
if (_isMobileLayout) {
|
||||
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),
|
||||
),
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
_complete('delete');
|
||||
},
|
||||
child: Text(
|
||||
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar',
|
||||
style: const TextStyle(color: Colors.red),
|
||||
),
|
||||
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 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) {
|
||||
|
||||
Reference in New Issue
Block a user