From f2ec887b3a36d413dc1caa03e9e38e6ba6650cab Mon Sep 17 00:00:00 2001 From: RafiaChy <rafiachowdhury24@gmail.com> Date: Fri, 21 Jan 2022 17:58:09 +0600 Subject: [PATCH] Set the curson position at the end of the value in the textfield. --- lib/src/screens/new_wallet/new_wallet_page.dart | 6 +++++- lib/src/screens/restore/wallet_restore_from_seed_form.dart | 7 ++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/lib/src/screens/new_wallet/new_wallet_page.dart b/lib/src/screens/new_wallet/new_wallet_page.dart index ad4f5560b..2d65a1c45 100644 --- a/lib/src/screens/new_wallet/new_wallet_page.dart +++ b/lib/src/screens/new_wallet/new_wallet_page.dart @@ -122,9 +122,13 @@ class _WalletNameFormState extends State<WalletNameForm> { setState(() { _controller.text = rName; _walletNewVM.name = rName; + _controller.selection = TextSelection.fromPosition( + TextPosition(offset: _controller.text.length)); }); }, - icon: Icon(Icons.refresh), + icon: Image.asset( + 'assets/images/refresh_icon.png', + ), ), hintStyle: TextStyle( fontSize: 18.0, diff --git a/lib/src/screens/restore/wallet_restore_from_seed_form.dart b/lib/src/screens/restore/wallet_restore_from_seed_form.dart index 97507f49e..8b8863961 100644 --- a/lib/src/screens/restore/wallet_restore_from_seed_form.dart +++ b/lib/src/screens/restore/wallet_restore_from_seed_form.dart @@ -68,9 +68,14 @@ class WalletRestoreFromSeedFormState extends State<WalletRestoreFromSeedForm> { print(rName); setState(() { nameTextEditingController.text = rName; + nameTextEditingController.selection = + TextSelection.fromPosition(TextPosition( + offset: nameTextEditingController.text.length)); }); }, - icon: Icon(Icons.refresh), + icon: Image.asset( + 'assets/images/refresh_icon.png', + ), ), ), Container(height: 20),