feat: Add autofocus to cubit text fields for keyboard displaying

This commit is contained in:
NaiJi 2023-08-10 23:21:45 -03:00
parent 5eadbd9e6b
commit a94965ab0d
13 changed files with 14 additions and 0 deletions

View file

@ -109,6 +109,7 @@ class ProviderInputDataPage extends StatelessWidget {
), ),
const SizedBox(height: 32), const SizedBox(height: 32),
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: providerCubit.apiKey, formFieldCubit: providerCubit.apiKey,
textAlign: TextAlign.center, textAlign: TextAlign.center,
scrollPadding: const EdgeInsets.only(bottom: 70), scrollPadding: const EdgeInsets.only(bottom: 70),

View file

@ -273,6 +273,7 @@ class InitializingPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<BackblazeFormCubit>().keyId, formFieldCubit: context.read<BackblazeFormCubit>().keyId,
textAlign: TextAlign.center, textAlign: TextAlign.center,
scrollPadding: const EdgeInsets.only(bottom: 70), scrollPadding: const EdgeInsets.only(bottom: 70),
@ -448,6 +449,7 @@ class InitializingPage extends StatelessWidget {
), ),
const SizedBox(height: 32), const SizedBox(height: 32),
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<RootUserFormCubit>().userName, formFieldCubit: context.read<RootUserFormCubit>().userName,
textAlign: TextAlign.center, textAlign: TextAlign.center,
scrollPadding: const EdgeInsets.only(bottom: 70), scrollPadding: const EdgeInsets.only(bottom: 70),

View file

@ -116,6 +116,7 @@ class ProviderInputDataPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: providerCubit.apiKey, formFieldCubit: providerCubit.apiKey,
textAlign: TextAlign.center, textAlign: TextAlign.center,
scrollPadding: const EdgeInsets.only(bottom: 70), scrollPadding: const EdgeInsets.only(bottom: 70),

View file

@ -65,6 +65,7 @@ class RecoverByNewDeviceKeyInput extends StatelessWidget {
ignoreBreakpoints: true, ignoreBreakpoints: true,
children: [ children: [
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: formFieldCubit:
context.read<RecoveryDeviceFormCubit>().tokenField, context.read<RecoveryDeviceFormCubit>().tokenField,
decoration: InputDecoration( decoration: InputDecoration(

View file

@ -76,6 +76,7 @@ class RecoverByOldToken extends StatelessWidget {
ignoreBreakpoints: true, ignoreBreakpoints: true,
children: [ children: [
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: formFieldCubit:
context.read<RecoveryDeviceFormCubit>().tokenField, context.read<RecoveryDeviceFormCubit>().tokenField,
decoration: InputDecoration( decoration: InputDecoration(

View file

@ -36,6 +36,7 @@ class RecoverByRecoveryKey extends StatelessWidget {
context.read<ServerInstallationCubit>().revertRecoveryStep, context.read<ServerInstallationCubit>().revertRecoveryStep,
children: [ children: [
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: formFieldCubit:
context.read<RecoveryDeviceFormCubit>().tokenField, context.read<RecoveryDeviceFormCubit>().tokenField,
decoration: InputDecoration( decoration: InputDecoration(

View file

@ -36,6 +36,7 @@ class RecoveryConfirmBackblaze extends StatelessWidget {
hasFlashButton: false, hasFlashButton: false,
children: [ children: [
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<BackblazeFormCubit>().keyId, formFieldCubit: context.read<BackblazeFormCubit>().keyId,
decoration: const InputDecoration( decoration: const InputDecoration(
border: OutlineInputBorder(), border: OutlineInputBorder(),

View file

@ -39,6 +39,7 @@ class RecoveryConfirmDns extends StatelessWidget {
context.read<ServerInstallationCubit>().revertRecoveryStep, context.read<ServerInstallationCubit>().revertRecoveryStep,
children: [ children: [
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<DnsProviderFormCubit>().apiKey, formFieldCubit: context.read<DnsProviderFormCubit>().apiKey,
decoration: InputDecoration( decoration: InputDecoration(
border: const OutlineInputBorder(), border: const OutlineInputBorder(),

View file

@ -121,6 +121,7 @@ class SelectDomainToRecover extends StatelessWidget {
}, },
children: [ children: [
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: formFieldCubit:
context.read<RecoveryDomainFormCubit>().serverDomainField, context.read<RecoveryDomainFormCubit>().serverDomainField,
decoration: InputDecoration( decoration: InputDecoration(

View file

@ -38,6 +38,7 @@ class RecoveryServerProviderConnected extends StatelessWidget {
}, },
children: [ children: [
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<ServerProviderFormCubit>().apiKey, formFieldCubit: context.read<ServerProviderFormCubit>().apiKey,
decoration: InputDecoration( decoration: InputDecoration(
border: const OutlineInputBorder(), border: const OutlineInputBorder(),

View file

@ -55,6 +55,7 @@ class NewUserPage extends StatelessWidget {
const SizedBox(width: 14), const SizedBox(width: 14),
IntrinsicHeight( IntrinsicHeight(
child: CubitFormTextField( child: CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<UserFormCubit>().login, formFieldCubit: context.read<UserFormCubit>().login,
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'users.login'.tr(), labelText: 'users.login'.tr(),

View file

@ -41,6 +41,7 @@ class ResetPassword extends StatelessWidget {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
CubitFormTextField( CubitFormTextField(
autofocus: true,
formFieldCubit: formFieldCubit:
context.read<UserFormCubit>().password, context.read<UserFormCubit>().password,
decoration: InputDecoration( decoration: InputDecoration(

View file

@ -296,6 +296,7 @@ class NewSshKey extends StatelessWidget {
children: [ children: [
IntrinsicHeight( IntrinsicHeight(
child: CubitFormTextField( child: CubitFormTextField(
autofocus: true,
formFieldCubit: context.read<SshFormCubit>().key, formFieldCubit: context.read<SshFormCubit>().key,
decoration: InputDecoration( decoration: InputDecoration(
labelText: 'ssh.input_label'.tr(), labelText: 'ssh.input_label'.tr(),