Skip to content

Commit

Permalink
feat: My account, modals, extract _onRemoveKeychainTap
Browse files Browse the repository at this point in the history
  • Loading branch information
digitalheartxs committed Sep 27, 2024
1 parent 0229234 commit 11276e6
Showing 1 changed file with 19 additions and 18 deletions.
37 changes: 19 additions & 18 deletions catalyst_voices/lib/pages/account/delete_keychain_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,7 @@ class _DeleteKeychainDialogState extends State<DeleteKeychainDialog> {
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<void>(
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),
Expand All @@ -153,4 +136,22 @@ class _DeleteKeychainDialogState extends State<DeleteKeychainDialog> {
),
);
}

Future<void> _onRemoveKeychainTap() async {
if (_textEditingController.text ==
context.l10n.deleteKeychainDialogRemovingPhrase) {
// TODO(Jakub): remove keychain
Navigator.of(context).pop();
await VoicesDialog.show<void>(
context: context,
builder: (context) {
return const KeychainDeletedDialog();
},
);
} else {
setState(() {
_errorText = context.l10n.deleteKeychainDialogErrorText;
});
}
}
}

0 comments on commit 11276e6

Please sign in to comment.