From a94965ab0df9dd98763264d70a492e4008325ccd Mon Sep 17 00:00:00 2001 From: NaiJi Date: Thu, 10 Aug 2023 23:21:45 -0300 Subject: [PATCH] feat: Add autofocus to cubit text fields for keyboard displaying --- lib/ui/pages/setup/initializing/dns_provider_picker.dart | 1 + lib/ui/pages/setup/initializing/initializing.dart | 2 ++ lib/ui/pages/setup/initializing/server_provider_picker.dart | 1 + lib/ui/pages/setup/recovering/recover_by_new_device_key.dart | 1 + lib/ui/pages/setup/recovering/recover_by_old_token.dart | 1 + lib/ui/pages/setup/recovering/recover_by_recovery_key.dart | 1 + lib/ui/pages/setup/recovering/recovery_confirm_backblaze.dart | 1 + lib/ui/pages/setup/recovering/recovery_confirm_dns.dart | 1 + lib/ui/pages/setup/recovering/recovery_routing.dart | 1 + .../setup/recovering/recovery_server_provider_connected.dart | 1 + lib/ui/pages/users/new_user.dart | 1 + lib/ui/pages/users/reset_password.dart | 1 + lib/ui/pages/users/user_details.dart | 1 + 13 files changed, 14 insertions(+) diff --git a/lib/ui/pages/setup/initializing/dns_provider_picker.dart b/lib/ui/pages/setup/initializing/dns_provider_picker.dart index a05b1233..772c093e 100644 --- a/lib/ui/pages/setup/initializing/dns_provider_picker.dart +++ b/lib/ui/pages/setup/initializing/dns_provider_picker.dart @@ -109,6 +109,7 @@ class ProviderInputDataPage extends StatelessWidget { ), const SizedBox(height: 32), CubitFormTextField( + autofocus: true, formFieldCubit: providerCubit.apiKey, textAlign: TextAlign.center, scrollPadding: const EdgeInsets.only(bottom: 70), diff --git a/lib/ui/pages/setup/initializing/initializing.dart b/lib/ui/pages/setup/initializing/initializing.dart index c74fa4a4..5d54935a 100644 --- a/lib/ui/pages/setup/initializing/initializing.dart +++ b/lib/ui/pages/setup/initializing/initializing.dart @@ -273,6 +273,7 @@ class InitializingPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ CubitFormTextField( + autofocus: true, formFieldCubit: context.read().keyId, textAlign: TextAlign.center, scrollPadding: const EdgeInsets.only(bottom: 70), @@ -448,6 +449,7 @@ class InitializingPage extends StatelessWidget { ), const SizedBox(height: 32), CubitFormTextField( + autofocus: true, formFieldCubit: context.read().userName, textAlign: TextAlign.center, scrollPadding: const EdgeInsets.only(bottom: 70), diff --git a/lib/ui/pages/setup/initializing/server_provider_picker.dart b/lib/ui/pages/setup/initializing/server_provider_picker.dart index bde1435c..41c4c9ea 100644 --- a/lib/ui/pages/setup/initializing/server_provider_picker.dart +++ b/lib/ui/pages/setup/initializing/server_provider_picker.dart @@ -116,6 +116,7 @@ class ProviderInputDataPage extends StatelessWidget { crossAxisAlignment: CrossAxisAlignment.start, children: [ CubitFormTextField( + autofocus: true, formFieldCubit: providerCubit.apiKey, textAlign: TextAlign.center, scrollPadding: const EdgeInsets.only(bottom: 70), diff --git a/lib/ui/pages/setup/recovering/recover_by_new_device_key.dart b/lib/ui/pages/setup/recovering/recover_by_new_device_key.dart index 4f6cf352..d1dce974 100644 --- a/lib/ui/pages/setup/recovering/recover_by_new_device_key.dart +++ b/lib/ui/pages/setup/recovering/recover_by_new_device_key.dart @@ -65,6 +65,7 @@ class RecoverByNewDeviceKeyInput extends StatelessWidget { ignoreBreakpoints: true, children: [ CubitFormTextField( + autofocus: true, formFieldCubit: context.read().tokenField, decoration: InputDecoration( diff --git a/lib/ui/pages/setup/recovering/recover_by_old_token.dart b/lib/ui/pages/setup/recovering/recover_by_old_token.dart index 42d60f34..1a777f83 100644 --- a/lib/ui/pages/setup/recovering/recover_by_old_token.dart +++ b/lib/ui/pages/setup/recovering/recover_by_old_token.dart @@ -76,6 +76,7 @@ class RecoverByOldToken extends StatelessWidget { ignoreBreakpoints: true, children: [ CubitFormTextField( + autofocus: true, formFieldCubit: context.read().tokenField, decoration: InputDecoration( diff --git a/lib/ui/pages/setup/recovering/recover_by_recovery_key.dart b/lib/ui/pages/setup/recovering/recover_by_recovery_key.dart index b39dc2da..ad18bc95 100644 --- a/lib/ui/pages/setup/recovering/recover_by_recovery_key.dart +++ b/lib/ui/pages/setup/recovering/recover_by_recovery_key.dart @@ -36,6 +36,7 @@ class RecoverByRecoveryKey extends StatelessWidget { context.read().revertRecoveryStep, children: [ CubitFormTextField( + autofocus: true, formFieldCubit: context.read().tokenField, decoration: InputDecoration( diff --git a/lib/ui/pages/setup/recovering/recovery_confirm_backblaze.dart b/lib/ui/pages/setup/recovering/recovery_confirm_backblaze.dart index a4d04aae..4b27e3ad 100644 --- a/lib/ui/pages/setup/recovering/recovery_confirm_backblaze.dart +++ b/lib/ui/pages/setup/recovering/recovery_confirm_backblaze.dart @@ -36,6 +36,7 @@ class RecoveryConfirmBackblaze extends StatelessWidget { hasFlashButton: false, children: [ CubitFormTextField( + autofocus: true, formFieldCubit: context.read().keyId, decoration: const InputDecoration( border: OutlineInputBorder(), diff --git a/lib/ui/pages/setup/recovering/recovery_confirm_dns.dart b/lib/ui/pages/setup/recovering/recovery_confirm_dns.dart index 02a2afeb..e49efe9e 100644 --- a/lib/ui/pages/setup/recovering/recovery_confirm_dns.dart +++ b/lib/ui/pages/setup/recovering/recovery_confirm_dns.dart @@ -39,6 +39,7 @@ class RecoveryConfirmDns extends StatelessWidget { context.read().revertRecoveryStep, children: [ CubitFormTextField( + autofocus: true, formFieldCubit: context.read().apiKey, decoration: InputDecoration( border: const OutlineInputBorder(), diff --git a/lib/ui/pages/setup/recovering/recovery_routing.dart b/lib/ui/pages/setup/recovering/recovery_routing.dart index be5eb2ea..3ab5109a 100644 --- a/lib/ui/pages/setup/recovering/recovery_routing.dart +++ b/lib/ui/pages/setup/recovering/recovery_routing.dart @@ -121,6 +121,7 @@ class SelectDomainToRecover extends StatelessWidget { }, children: [ CubitFormTextField( + autofocus: true, formFieldCubit: context.read().serverDomainField, decoration: InputDecoration( diff --git a/lib/ui/pages/setup/recovering/recovery_server_provider_connected.dart b/lib/ui/pages/setup/recovering/recovery_server_provider_connected.dart index 86a1bf44..40f13eaa 100644 --- a/lib/ui/pages/setup/recovering/recovery_server_provider_connected.dart +++ b/lib/ui/pages/setup/recovering/recovery_server_provider_connected.dart @@ -38,6 +38,7 @@ class RecoveryServerProviderConnected extends StatelessWidget { }, children: [ CubitFormTextField( + autofocus: true, formFieldCubit: context.read().apiKey, decoration: InputDecoration( border: const OutlineInputBorder(), diff --git a/lib/ui/pages/users/new_user.dart b/lib/ui/pages/users/new_user.dart index d7ed2aca..9212307a 100644 --- a/lib/ui/pages/users/new_user.dart +++ b/lib/ui/pages/users/new_user.dart @@ -55,6 +55,7 @@ class NewUserPage extends StatelessWidget { const SizedBox(width: 14), IntrinsicHeight( child: CubitFormTextField( + autofocus: true, formFieldCubit: context.read().login, decoration: InputDecoration( labelText: 'users.login'.tr(), diff --git a/lib/ui/pages/users/reset_password.dart b/lib/ui/pages/users/reset_password.dart index 64785d3a..12bb41ae 100644 --- a/lib/ui/pages/users/reset_password.dart +++ b/lib/ui/pages/users/reset_password.dart @@ -41,6 +41,7 @@ class ResetPassword extends StatelessWidget { mainAxisSize: MainAxisSize.min, children: [ CubitFormTextField( + autofocus: true, formFieldCubit: context.read().password, decoration: InputDecoration( diff --git a/lib/ui/pages/users/user_details.dart b/lib/ui/pages/users/user_details.dart index 72180e8c..7ee3a7bd 100644 --- a/lib/ui/pages/users/user_details.dart +++ b/lib/ui/pages/users/user_details.dart @@ -296,6 +296,7 @@ class NewSshKey extends StatelessWidget { children: [ IntrinsicHeight( child: CubitFormTextField( + autofocus: true, formFieldCubit: context.read().key, decoration: InputDecoration( labelText: 'ssh.input_label'.tr(),