'Flutter: Android 12 keyboard showing white space

I am implementing flutter app having TextFormField in my login screen to capture credentials. When I ran it on Android Emulator with 12.0 or real device with Android 12 it is showing white container instead of keyboard. It is happening with Android 12 only. Could some please help me on this? Thanks in Advance.

Note: It is working fine on all iOS Versions.

return Form(
        key: _formKeySignInInputs,
        child: Stack(
          children: [
            SingleChildScrollView(
              scrollDirection: Axis.vertical,
              child: Column(
                children: [
                  Padding(padding: EdgeInsets.fromLTRB(0, 8, 0, 8.vw),
                      child: buildEmailFormField()),
                  Padding(padding: EdgeInsets.fromLTRB(0, 0, 0, 2.vw),
                      child: buildPasswordFormField()),
                  Padding(padding: EdgeInsets.fromLTRB(2.vw, 0, 0, 4.vw),
                ],
              ),
            )
          ],
        )
    );
  }


  TextFormField buildPasswordFormField() {
    var localeContext = AppLocalizations.of(context)!;

    return TextFormField(
      autocorrect: false,
      obscureText: true,
      enableSuggestions: false,
      onSaved: (newValue) => password = newValue,
      onChanged: (value) {
        if (value.isNotEmpty) {
          removeError(error: localeContext.password_null_error);
        } else if (value.length >= 4) {
          removeError(error: localeContext.short_password_error);
        }
        return;
      },
      validator: (value) {
        if (value!.isEmpty) {
          addError(error: localeContext.password_null_error);
          return "";
        } else if (value.length < 4) {
          addError(error: localeContext.short_password_error);
          return "";
        }
      },
      decoration: InputDecoration(
        labelText: localeContext.password,
        hintText: localeContext.password_hint,
        floatingLabelBehavior: FloatingLabelBehavior.always,
        suffixIcon: const InputFieldSurffixIcon(svgIcon: "assets/icons/password.svg"),
      ),
    );
  }

  TextFormField buildEmailFormField() {
    var localeContext = AppLocalizations.of(context)!;

    return TextFormField(
      autocorrect: false,
      enableSuggestions: false,
      keyboardType: TextInputType.emailAddress,
      onSaved: (newValue) => email = newValue,
      onChanged: (value) {
        if (value.isNotEmpty) {
          removeError(error: localeContext.email_null_error);
        } else if (emailValidatorRegExp.hasMatch(value)) {
          removeError(error: localeContext.invalid_email_error);
        }
      },
      validator: (value) {
        if (value!.isEmpty) {
          addError(error: localeContext.email_null_error);
          return "";
        } else if (!emailValidatorRegExp.hasMatch(value)) {
          addError(error: localeContext.invalid_email_error);
          return "";
        }
      },
      decoration: InputDecoration(
        labelText: localeContext.email,
        hintText: localeContext.email_hint,
        floatingLabelBehavior: FloatingLabelBehavior.always,
        suffixIcon: const InputFieldSurffixIcon(svgIcon: "assets/icons/temp/mail.svg"),
      ),
    );
  }


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source