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: [
|
children: [
|
||||||
const Icon(
|
const Icon(
|
||||||
Icons.fingerprint,
|
Icons.fingerprint,
|
||||||
color: Colors.amber,
|
|
||||||
size: 44,
|
size: 44,
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|||||||
@@ -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),
|
||||||
|
|||||||
@@ -65,7 +65,9 @@ class NoteEditorScreen extends StatefulWidget {
|
|||||||
if (!completer.isCompleted) {
|
if (!completer.isCompleted) {
|
||||||
completer.complete(result);
|
completer.complete(result);
|
||||||
}
|
}
|
||||||
entry.remove();
|
if (entry.mounted) {
|
||||||
|
entry.remove();
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -146,45 +148,173 @@ 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(
|
|
||||||
context: context,
|
if (_isMobileLayout) {
|
||||||
builder: (BuildContext context) {
|
final bool? confirmed = await showDialog<bool>(
|
||||||
return AlertDialog(
|
context: context,
|
||||||
backgroundColor: const Color(0xFF303134),
|
barrierDismissible: false,
|
||||||
title: Text(
|
barrierColor: Colors.transparent,
|
||||||
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar nota',
|
builder: (BuildContext dialogContext) {
|
||||||
style: const TextStyle(color: Colors.white),
|
return AlertDialog(
|
||||||
),
|
backgroundColor: const Color(0xFF303134),
|
||||||
content: Text(
|
title: Text(
|
||||||
isDeletedNote
|
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar nota',
|
||||||
? 'Esta nota ya está borrada. Si la eliminas ahora, se borrará permanentemente.'
|
style: const TextStyle(color: Colors.white),
|
||||||
: '¿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),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
TextButton(
|
content: Text(
|
||||||
onPressed: () {
|
isDeletedNote
|
||||||
Navigator.of(context).pop();
|
? 'Esta nota ya está borrada. Si la eliminas ahora, se borrará permanentemente.'
|
||||||
_complete('delete');
|
: '¿Estás seguro de que deseas eliminar esta nota?',
|
||||||
},
|
style: const TextStyle(color: Colors.white70),
|
||||||
child: Text(
|
|
||||||
isDeletedNote ? 'Eliminar permanentemente' : 'Eliminar',
|
|
||||||
style: const TextStyle(color: Colors.red),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
],
|
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) {
|
String _formatDate(DateTime date) {
|
||||||
|
|||||||
Reference in New Issue
Block a user