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),
CubitFormTextField(
autofocus: true,
formFieldCubit: providerCubit.apiKey,
textAlign: TextAlign.center,
scrollPadding: const EdgeInsets.only(bottom: 70),

View file

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

View file

@ -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),

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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

View file

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