From 16718b94e600899e53b0d4f8cd6680e21df3eb55 Mon Sep 17 00:00:00 2001 From: julian Date: Mon, 11 Sep 2023 17:54:01 -0600 Subject: [PATCH] revert auto focus next field on valid mnemonic word --- .../restore_wallet_view.dart | 92 +++++++++---------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart index 87219d277..1a62af746 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart @@ -98,7 +98,7 @@ class _RestoreWalletViewState extends ConsumerState { final List _controllers = []; final List _inputStatuses = []; - final List _focusNodes = []; + // final List _focusNodes = []; late final BarcodeScannerInterface scanner; @@ -152,7 +152,7 @@ class _RestoreWalletViewState extends ConsumerState { for (int i = 0; i < _seedWordCount; i++) { _controllers.add(TextEditingController()); _inputStatuses.add(FormInputStatus.empty); - _focusNodes.add(FocusNode()); + // _focusNodes.add(FocusNode()); } super.initState(); @@ -821,8 +821,8 @@ class _RestoreWalletViewState extends ConsumerState { i * 4 + j - 1 == 1 ? textSelectionControls : null, - focusNode: - _focusNodes[i * 4 + j - 1], + // focusNode: + // _focusNodes[i * 4 + j - 1], onChanged: (value) { final FormInputStatus formInputStatus; @@ -841,18 +841,18 @@ class _RestoreWalletViewState extends ConsumerState { FormInputStatus.invalid; } - if (formInputStatus == - FormInputStatus.valid) { - if (i * 4 + j < - _focusNodes.length) { - _focusNodes[i * 4 + j] - .requestFocus(); - } else if (i * 4 + j == - _focusNodes.length) { - _focusNodes[i * 4 + j - 1] - .unfocus(); - } - } + // if (formInputStatus == + // FormInputStatus.valid) { + // if (i * 4 + j < + // _focusNodes.length) { + // _focusNodes[i * 4 + j] + // .requestFocus(); + // } else if (i * 4 + j == + // _focusNodes.length) { + // _focusNodes[i * 4 + j - 1] + // .unfocus(); + // } + // } setState(() { _inputStatuses[i * 4 + j - @@ -929,7 +929,7 @@ class _RestoreWalletViewState extends ConsumerState { selectionControls: i == 1 ? textSelectionControls : null, - focusNode: _focusNodes[i], + // focusNode: _focusNodes[i], onChanged: (value) { final FormInputStatus formInputStatus; @@ -948,27 +948,27 @@ class _RestoreWalletViewState extends ConsumerState { FormInputStatus.invalid; } - if (formInputStatus == - FormInputStatus - .valid && - (i - 1) < - _focusNodes.length) { - Focus.of(context) - .requestFocus( - _focusNodes[i]); - } + // if (formInputStatus == + // FormInputStatus + // .valid && + // (i - 1) < + // _focusNodes.length) { + // Focus.of(context) + // .requestFocus( + // _focusNodes[i]); + // } - if (formInputStatus == - FormInputStatus.valid) { - if (i + 1 < - _focusNodes.length) { - _focusNodes[i + 1] - .requestFocus(); - } else if (i + 1 == - _focusNodes.length) { - _focusNodes[i].unfocus(); - } - } + // if (formInputStatus == + // FormInputStatus.valid) { + // if (i + 1 < + // _focusNodes.length) { + // _focusNodes[i + 1] + // .requestFocus(); + // } else if (i + 1 == + // _focusNodes.length) { + // _focusNodes[i].unfocus(); + // } + // } }, controller: _controllers[i], style: @@ -1068,7 +1068,7 @@ class _RestoreWalletViewState extends ConsumerState { AutovalidateMode.onUserInteraction, selectionControls: i == 1 ? textSelectionControls : null, - focusNode: _focusNodes[i - 1], + // focusNode: _focusNodes[i - 1], onChanged: (value) { final FormInputStatus formInputStatus; @@ -1084,14 +1084,14 @@ class _RestoreWalletViewState extends ConsumerState { FormInputStatus.invalid; } - if (formInputStatus == - FormInputStatus.valid) { - if (i < _focusNodes.length) { - _focusNodes[i].requestFocus(); - } else if (i == _focusNodes.length) { - _focusNodes[i - 1].unfocus(); - } - } + // if (formInputStatus == + // FormInputStatus.valid) { + // if (i < _focusNodes.length) { + // _focusNodes[i].requestFocus(); + // } else if (i == _focusNodes.length) { + // _focusNodes[i - 1].unfocus(); + // } + // } setState(() { _inputStatuses[i - 1] = formInputStatus;