From be81042a0610e5ff7d00a9dc9e6948cd5bf982a2 Mon Sep 17 00:00:00 2001 From: Serhii Date: Fri, 28 Mar 2025 00:18:50 +0200 Subject: [PATCH] Cw 1018 minor UI enhancements (#2118) * fix ui for monero batch sending * minor ui fixes * Revert "fix ui for monero batch sending" This reverts commit 4827b17bfeefe897dc7b6580d0520ff02aa9683f. * fix: focus node issue --- .../wallet_group_description_page.dart | 60 ++++++++++--------- ..._group_existing_seed_description_page.dart | 42 ++++++------- lib/src/screens/send/send_page.dart | 5 +- .../info_bottom_sheet_widget.dart | 3 +- 4 files changed, 60 insertions(+), 50 deletions(-) diff --git a/lib/src/screens/new_wallet/wallet_group_description_page.dart b/lib/src/screens/new_wallet/wallet_group_description_page.dart index b566d0422..e10c64bf9 100644 --- a/lib/src/screens/new_wallet/wallet_group_description_page.dart +++ b/lib/src/screens/new_wallet/wallet_group_description_page.dart @@ -29,37 +29,41 @@ class WalletGroupDescriptionPage extends BasePage { Image.asset(currentTheme.type.walletGroupImage, height: 200), SizedBox(height: 32), Expanded( - child: Text.rich( - TextSpan( - children: [ - TextSpan(text: '${S.of(context).wallet_group_description_one} '), + child: Scrollbar( + child: SingleChildScrollView( + child: Text.rich( TextSpan( - text: '${S.of(context).wallet_group.toLowerCase()} ', - style: TextStyle(fontWeight: FontWeight.w700), + children: [ + TextSpan(text: '${S.of(context).wallet_group_description_one} '), + TextSpan( + text: '${S.of(context).wallet_group.toLowerCase()} ', + style: TextStyle(fontWeight: FontWeight.w700), + ), + TextSpan( + text: '${S.of(context).wallet_group_description_two} ', + ), + TextSpan( + text: '${S.of(context).choose_wallet_group} ', + style: TextStyle(fontWeight: FontWeight.w700), + ), + TextSpan( + text: '${S.of(context).wallet_group_description_three} ', + ), + TextSpan( + text: '${S.of(context).create_new_seed} ', + style: TextStyle(fontWeight: FontWeight.w700), + ), + TextSpan(text: S.of(context).wallet_group_description_four), + ], ), - TextSpan( - text: '${S.of(context).wallet_group_description_two} ', + textAlign: TextAlign.center, + style: TextStyle( + height: 1.5, + fontSize: 16, + fontWeight: FontWeight.w400, + color: Theme.of(context).extension()!.secondaryTextColor, ), - TextSpan( - text: '${S.of(context).choose_wallet_group} ', - style: TextStyle(fontWeight: FontWeight.w700), - ), - TextSpan( - text: '${S.of(context).wallet_group_description_three} ', - ), - TextSpan( - text: '${S.of(context).create_new_seed} ', - style: TextStyle(fontWeight: FontWeight.w700), - ), - TextSpan(text: S.of(context).wallet_group_description_four), - ], - ), - textAlign: TextAlign.center, - style: TextStyle( - height: 1.5, - fontSize: 16, - fontWeight: FontWeight.w400, - color: Theme.of(context).extension()!.secondaryTextColor, + ), ), ), ), diff --git a/lib/src/screens/new_wallet/wallet_group_existing_seed_description_page.dart b/lib/src/screens/new_wallet/wallet_group_existing_seed_description_page.dart index 4eab8fcec..34e07bbaf 100644 --- a/lib/src/screens/new_wallet/wallet_group_existing_seed_description_page.dart +++ b/lib/src/screens/new_wallet/wallet_group_existing_seed_description_page.dart @@ -32,28 +32,30 @@ class WalletGroupExistingSeedDescriptionPage extends BasePage { Image.asset(currentTheme.type.walletGroupImage, height: 200), SizedBox(height: 32), Expanded( - child: RichText( - text: TextSpan( - children: [ - TextSpan( - text: S.current.wallet_group_description_existing_seed + '\n\n', - style: textStyle), - TextSpan( - text: S.current.wallet_group_description_open_wallet + '\n\n', - style: textStyle), - TextSpan( - text: S.current.wallet_group_description_view_seed + '\n', style: textStyle), - TextSpan( - text: S.current.seed_display_path, - style: TextStyle( - fontSize: 16, - fontWeight: FontWeight.w800, - color: Theme.of(context).extension()!.secondaryTextColor, + child: SingleChildScrollView( + child: RichText( + text: TextSpan( + children: [ + TextSpan( + text: S.current.wallet_group_description_existing_seed + '\n\n', + style: textStyle), + TextSpan( + text: S.current.wallet_group_description_open_wallet + '\n\n', + style: textStyle), + TextSpan( + text: S.current.wallet_group_description_view_seed + '\n', style: textStyle), + TextSpan( + text: S.current.seed_display_path, + style: TextStyle( + fontSize: 16, + fontWeight: FontWeight.w800, + color: Theme.of(context).extension()!.secondaryTextColor, + ), ), - ), - ], + ], + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, ), ), Column( diff --git a/lib/src/screens/send/send_page.dart b/lib/src/screens/send/send_page.dart index d02d246fa..277986c3f 100644 --- a/lib/src/screens/send/send_page.dart +++ b/lib/src/screens/send/send_page.dart @@ -397,7 +397,10 @@ class SendPage extends BasePage { return LoadingPrimaryButton( key: ValueKey('send_page_send_button_key'), onPressed: () async { - FocusManager.instance.primaryFocus?.unfocus(); + + //Request dummy node to get the focus out of the text fields + FocusScope.of(context).requestFocus(FocusNode()); + if (sendViewModel.state is IsExecutingState) return; if (_formKey.currentState != null && !_formKey.currentState!.validate()) { diff --git a/lib/src/widgets/bottom_sheet/info_bottom_sheet_widget.dart b/lib/src/widgets/bottom_sheet/info_bottom_sheet_widget.dart index 26d25b50d..c3ccd7987 100644 --- a/lib/src/widgets/bottom_sheet/info_bottom_sheet_widget.dart +++ b/lib/src/widgets/bottom_sheet/info_bottom_sheet_widget.dart @@ -1,3 +1,4 @@ +import 'package:auto_size_text/auto_size_text.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/themes/extensions/cake_text_theme.dart'; import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart'; @@ -85,7 +86,7 @@ class InfoBottomSheet extends BaseBottomSheet { const Spacer(flex: 2), Expanded( flex: 6, - child: Text( + child: AutoSizeText( content!, textAlign: TextAlign.center, style: TextStyle(