CW-636-1-Unfocus text fields when push to next one (#1460)

* unfocus text fields when push to next one

* unfocus when push to next from new wallet / restore pages[skip ci]]
This commit is contained in:
Serhii
2024-05-31 17:57:40 +03:00
committed by GitHub
parent 43a4477b39
commit 287c2d8b60
10 changed files with 90 additions and 24 deletions
@@ -21,6 +21,14 @@ class RestoreFromBackupPage extends BasePage {
@override
String get title => S.current.restore_title_from_backup;
@override
Function(BuildContext)? get pushToNextWidget => (context) {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.focusedChild?.unfocus();
}
};
@override
Widget body(BuildContext context) {
reaction((_) => restoreFromBackupViewModel.state, (ExecutionState state) {
@@ -101,6 +101,14 @@ class WalletRestorePage extends BasePage {
// String? derivationPath = null;
DerivationInfo? derivationInfo;
@override
Function(BuildContext)? get pushToNextWidget => (context) {
FocusScopeNode currentFocus = FocusScope.of(context);
if (!currentFocus.hasPrimaryFocus) {
currentFocus.focusedChild?.unfocus();
}
};
@override
Widget body(BuildContext context) {
reaction((_) => walletRestoreViewModel.state, (ExecutionState state) {