From 11276e628c7fd24b0323040d99047b2ab6820415 Mon Sep 17 00:00:00 2001 From: digitalheartxs Date: Fri, 27 Sep 2024 11:07:25 +0200 Subject: [PATCH] feat: My account, modals, extract _onRemoveKeychainTap --- .../pages/account/delete_keychain_dialog.dart | 37 ++++++++++--------- 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/catalyst_voices/lib/pages/account/delete_keychain_dialog.dart b/catalyst_voices/lib/pages/account/delete_keychain_dialog.dart index 8f5842118c..16d87cf70e 100644 --- a/catalyst_voices/lib/pages/account/delete_keychain_dialog.dart +++ b/catalyst_voices/lib/pages/account/delete_keychain_dialog.dart @@ -116,24 +116,7 @@ class _DeleteKeychainDialogState extends State { children: [ VoicesFilledButton( backgroundColor: Theme.of(context).colors.iconsError, - onTap: () async { - if (_textEditingController.text == - context.l10n.deleteKeychainDialogRemovingPhrase) { - // TODO(Jakub): remove keychain - Navigator.of(context).pop(); - await VoicesDialog.show( - context: context, - builder: (context) { - return const KeychainDeletedDialog(); - }, - ); - } else { - setState(() { - _errorText = - context.l10n.deleteKeychainDialogErrorText; - }); - } - }, + onTap: () async => _onRemoveKeychainTap(), child: Text(context.l10n.delete), ), const SizedBox(width: 8), @@ -153,4 +136,22 @@ class _DeleteKeychainDialogState extends State { ), ); } + + Future _onRemoveKeychainTap() async { + if (_textEditingController.text == + context.l10n.deleteKeychainDialogRemovingPhrase) { + // TODO(Jakub): remove keychain + Navigator.of(context).pop(); + await VoicesDialog.show( + context: context, + builder: (context) { + return const KeychainDeletedDialog(); + }, + ); + } else { + setState(() { + _errorText = context.l10n.deleteKeychainDialogErrorText; + }); + } + } }