mirror of
https://github.com/koloideal/Casha.git
synced 2026-06-10 10:25:28 +03:00
stableee
This commit is contained in:
@@ -76,8 +76,8 @@ class AppStrings {
|
|||||||
String get data => _ru ? 'Данные' : 'Data';
|
String get data => _ru ? 'Данные' : 'Data';
|
||||||
String get exportData => _ru ? 'Экспорт данных' : 'Export data';
|
String get exportData => _ru ? 'Экспорт данных' : 'Export data';
|
||||||
String get clearData => _ru ? 'Очистить данные' : 'Clear all data';
|
String get clearData => _ru ? 'Очистить данные' : 'Clear all data';
|
||||||
String get clearAllTransactions => _ru ? 'Очистить все транзакции' : 'Clear All Transactions';
|
String get clearAllTransactions => _ru ? 'Удалить транзакции' : 'Clear All Transactions';
|
||||||
String get clearDataConfirm => _ru ? 'Удалить все транзакции?' : 'Clear all transactions?';
|
String get clearDataConfirm => _ru ? 'Удалить транзакции?' : 'Clear all transactions?';
|
||||||
String get clearDataWarning => _ru ? 'Это навсегда удалит всю историю транзакций. Это действие нельзя отменить.' : 'This will permanently delete all your transaction history. This cannot be undone.';
|
String get clearDataWarning => _ru ? 'Это навсегда удалит всю историю транзакций. Это действие нельзя отменить.' : 'This will permanently delete all your transaction history. This cannot be undone.';
|
||||||
String get areYouSure => _ru ? 'Вы абсолютно уверены?' : 'Are you absolutely sure?';
|
String get areYouSure => _ru ? 'Вы абсолютно уверены?' : 'Are you absolutely sure?';
|
||||||
String get allTransactionsDeleted => _ru ? 'Все транзакции удалены' : 'All transactions deleted';
|
String get allTransactionsDeleted => _ru ? 'Все транзакции удалены' : 'All transactions deleted';
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ class SettingsScreen extends ConsumerWidget {
|
|||||||
final s = ref.read(stringsProvider);
|
final s = ref.read(stringsProvider);
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
barrierDismissible: false,
|
||||||
builder: (ctx) => AlertDialog(
|
builder: (ctx) => AlertDialog(
|
||||||
title: Text(s.clearDataConfirm),
|
title: Text(s.clearDataConfirm),
|
||||||
content: Text(s.clearDataWarning),
|
content: Text(s.clearDataWarning),
|
||||||
@@ -29,10 +30,11 @@ class SettingsScreen extends ConsumerWidget {
|
|||||||
child: Text(s.cancel),
|
child: Text(s.cancel),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
Navigator.pop(ctx);
|
Navigator.pop(ctx);
|
||||||
showDialog(
|
await showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
|
barrierDismissible: false,
|
||||||
builder: (ctx2) => AlertDialog(
|
builder: (ctx2) => AlertDialog(
|
||||||
title: Text(s.areYouSure),
|
title: Text(s.areYouSure),
|
||||||
content: Text(s.allTransactionsWillBeDeleted),
|
content: Text(s.allTransactionsWillBeDeleted),
|
||||||
@@ -42,11 +44,42 @@ class SettingsScreen extends ConsumerWidget {
|
|||||||
child: Text(s.noKeepThem),
|
child: Text(s.noKeepThem),
|
||||||
),
|
),
|
||||||
TextButton(
|
TextButton(
|
||||||
onPressed: () {
|
onPressed: () async {
|
||||||
|
final biometricEnabled = await BiometricService.isEnabled();
|
||||||
|
if (biometricEnabled) {
|
||||||
|
final authenticated = await BiometricService.authenticate();
|
||||||
|
if (!authenticated) {
|
||||||
|
Navigator.pop(ctx2);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
ref.read(transactionsProvider.notifier).clearAll();
|
ref.read(transactionsProvider.notifier).clearAll();
|
||||||
Navigator.pop(ctx2);
|
Navigator.pop(ctx2);
|
||||||
|
|
||||||
ScaffoldMessenger.of(context).showSnackBar(
|
ScaffoldMessenger.of(context).showSnackBar(
|
||||||
SnackBar(content: Text(s.allTransactionsDeleted)),
|
SnackBar(
|
||||||
|
content: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.check_circle_rounded,
|
||||||
|
color: Colors.white,
|
||||||
|
size: 20,
|
||||||
|
),
|
||||||
|
const SizedBox(width: 12),
|
||||||
|
Text(
|
||||||
|
s.allTransactionsDeleted,
|
||||||
|
style: const TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
backgroundColor: const Color(0xFF4CAF50),
|
||||||
|
behavior: SnackBarBehavior.fixed,
|
||||||
|
duration: const Duration(seconds: 3),
|
||||||
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
style: TextButton.styleFrom(
|
style: TextButton.styleFrom(
|
||||||
|
|||||||
Reference in New Issue
Block a user