diff --git a/lib/screens/create_wallet/encrypt_wallet_card.dart b/lib/screens/create_wallet/encrypt_wallet_card.dart index 5e7cbce9..0c81d4c6 100644 --- a/lib/screens/create_wallet/encrypt_wallet_card.dart +++ b/lib/screens/create_wallet/encrypt_wallet_card.dart @@ -132,6 +132,35 @@ class EncryptWalletCardState extends State super.dispose(); } + List buildLocalizedTextBlock(BuildContext context) { + final theme = Theme.of(context); + Map _encryptWalletTextLocalization(BuildContext context) => { + 0: AppLocalizations.of(context)!.encryptWalletHeader, + 1: AppLocalizations.of(context)!.encryptWallet01, + 2: AppLocalizations.of(context)!.encryptWallet02, + 3: AppLocalizations.of(context)!.encryptWallet03(Locator.instance + .get() + .seedData! + .split(' ') + .length), + }; + List _widgets = []; + List _localization = + _encryptWalletTextLocalization(context).values.toList(); + + // for each item, add a text widget and a spacer SizedBox + // if it is the first item, set the text style for a header + _encryptWalletTextLocalization(context).forEach((key, value) { + _widgets.add(Text( + _localization[key], + style: + key == 0 ? theme.textTheme.titleLarge : theme.textTheme.bodyLarge, + )); + _widgets.add(SizedBox(height: 8)); + }); + return _widgets; + } + @override Widget build(BuildContext context) { _passConfirmFocusNode.addListener(() => validateForm()); @@ -140,30 +169,8 @@ class EncryptWalletCardState extends State return Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - Text( - AppLocalizations.of(context)!.encryptWalletHeader, - style: theme.textTheme.titleLarge, - ), + ...buildLocalizedTextBlock(context), SizedBox(height: 8), - Text( - AppLocalizations.of(context)!.encryptWallet01, - style: theme.textTheme.bodyLarge, - ), - SizedBox(height: 8), - Text( - AppLocalizations.of(context)!.encryptWallet02, - style: theme.textTheme.bodyLarge, - ), - SizedBox(height: 8), - Text( - AppLocalizations.of(context)!.encryptWallet03(Locator.instance - .get() - .seedData! - .split(' ') - .length), - style: theme.textTheme.bodyLarge, - ), - SizedBox(height: 16), Form( autovalidateMode: AutovalidateMode.onUserInteraction, child: Column(