Clicking on "Email" Textfied (not obscureText), keyboard did not appears, or appears and disappers in 1 second


This issue occurs on ANDROID EMULATOR and MOBILE (real), both with android 16.
In short words: If field is OBSCURED = TRUE show keyboard, if NOT didn't SHOW!

Clicking on PASSWORD (field) that is obscured = true, keyboard is appears as well. If I put this configuration on Email field AND REMOVE keyboardtype, works well.

How to reproduce
Create a project
flutter create teste --platforms linux,android
On main.dart, create a simple signin class generated with 2 fields (emais and password) and 1 signin button. I used generated by Gemini, ChatGPT or manually.

Notes:
* Nothing was changed on pubsec.yaml.
* flutter clean ; flutter pub get was run between test/changes.
* It works on past, for some reason, stop to work. I don't know when stopped.
* Tested with Flutter 3.47.0 and 3.47.9
* I had tried suggestions from Stack Overflow, Medium and others forums without success.

Code used, console logs and screenshots can be found on Github repository.
<https://github.com/RonaldoSCouto/TextField_Keyboard.git>

Basically: IMAGES NOT WORKING: Clicking on Email Field,FAIL for it Clicking on Password Field, OK for it

              // Email field  DIDN&#39;T SHOW KEYBOARD
              TextField(
                controller: _emailController,
                keyboardType: TextInputType.emailAddress,
                decoration: const InputDecoration(
                  labelText: &#39;Email&#39;,
                  hintText: &#39;Enter your email&#39;,
                  prefixIcon: Icon(Icons.email),
                  border: OutlineInputBorder(),
                ),
              ),

IMAGES after change Email field to OBSCURED: Email field as OBSCURED Password field stay the same, after Email obscured

             // Email field  SHOW KEYBOARD
              TextField(
                controller: _emailController,
                //keyboardType: TextInputType.emailAddress,
                obscureText: _obscurePassword,
                decoration: const InputDecoration(
                  labelText: &#39;Email&#39;,
                  hintText: &#39;Enter your email&#39;,
                  prefixIcon: Icon(Icons.email),
                  border: OutlineInputBorder(),
                ),
              ),

Scaffold block:

   return Scaffold(
      appBar: AppBar(title: const Text(&#39;Login&#39;), centerTitle: true),
      body: Center(
        child: SingleChildScrollView(
          padding: const EdgeInsets.all(24.0),
          child: Column(
            mainAxisAlignment: MainAxisAlignment.center,
            crossAxisAlignment: CrossAxisAlignment.stretch,
            children: [
              const Icon(Icons.account_circle, size: 90, color: Colors.blue),

              const SizedBox(height: 32),

              // Email field
              TextField(
                controller: _emailController,
                //keyboardType: TextInputType.emailAddress,
                obscureText: _obscurePassword,
                decoration: const InputDecoration(
                  labelText: &#39;Email&#39;,
                  hintText: &#39;Enter your email&#39;,
                  prefixIcon: Icon(Icons.email),
                  border: OutlineInputBorder(),
                ),
              ),

              const SizedBox(height: 16),

              // Password field
              TextField(
                controller: _passwordController,
                obscureText: _obscurePassword,
                decoration: InputDecoration(
                  labelText: &#39;Password&#39;,
                  hintText: &#39;Enter your password&#39;,
                  prefixIcon: const Icon(Icons.lock),
                  border: const OutlineInputBorder(),
                  suffixIcon: IconButton(
                    icon: Icon(
                      _obscurePassword
                          ? Icons.visibility
                          : Icons.visibility_off,
                    ),
                    onPressed: () {
                      setState(() {
                        _obscurePassword = !_obscurePassword;
                      });
                    },
                  ),
                ),
              ),

              const SizedBox(height: 24),

              // Login button
              ElevatedButton(
                onPressed: _login,
                style: ElevatedButton.styleFrom(
                  padding: const EdgeInsets.symmetric(vertical: 16),
                ),
                child: const Text(&#39;Login&#39;),
              ),

              // Create account button
              TextButton(
                onPressed: _createAccount,
                child: const Text(&#39;Create Account&#39;),
              ),
            ],
          ),
        ),
      ),
    );

Manifest.xml (As generated by Flutter create)

&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
    &lt;application
        android:label=&quot;teste&quot;
        android:name=&quot;${applicationName}&quot;
        android:icon=&quot;@mipmap/ic_launcher&quot;&gt;
        &lt;activity
            android:name=&quot;.MainActivity&quot;
            android:exported=&quot;true&quot;
            android:launchMode=&quot;singleTop&quot;
            android:taskAffinity=&quot;&quot;
            android:theme=&quot;@style/LaunchTheme&quot;
            android:configChanges=&quot;orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode&quot;
            android:hardwareAccelerated=&quot;true&quot;
            android:windowSoftInputMode=&quot;adjustResize&quot;&gt;
            &lt;!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. --&gt;
            &lt;meta-data
              android:name=&quot;io.flutter.embedding.android.NormalTheme&quot;
              android:resource=&quot;@style/NormalTheme&quot;
              /&gt;
            &lt;intent-filter&gt;
                &lt;action android:name=&quot;android.intent.action.MAIN&quot;/&gt;
                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;/&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;!-- Don&#39;t delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --&gt;
        &lt;meta-data
            android:name=&quot;flutterEmbedding&quot;
            android:value=&quot;2&quot; /&gt;
    &lt;/application&gt;
    &lt;!-- Required to query activities that can process text, see:
         https://developer.android.com/training/package-visibility and
         https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

         In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. --&gt;
    &lt;queries&gt;
        &lt;intent&gt;
            &lt;action android:name=&quot;android.intent.action.PROCESS_TEXT&quot;/&gt;
            &lt;data android:mimeType=&quot;text/plain&quot;/&gt;
        &lt;/intent&gt;
    &lt;/queries&gt;
&lt;/manifest&gt;&lt;manifest xmlns:android=&quot;http://schemas.android.com/apk/res/android&quot;&gt;
    &lt;application
        android:label=&quot;teste&quot;
        android:name=&quot;${applicationName}&quot;
        android:icon=&quot;@mipmap/ic_launcher&quot;&gt;
        &lt;activity
            android:name=&quot;.MainActivity&quot;
            android:exported=&quot;true&quot;
            android:launchMode=&quot;singleTop&quot;
            android:taskAffinity=&quot;&quot;
            android:theme=&quot;@style/LaunchTheme&quot;
            android:configChanges=&quot;orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode&quot;
            android:hardwareAccelerated=&quot;true&quot;
            android:windowSoftInputMode=&quot;adjustResize&quot;&gt;
            &lt;!-- Specifies an Android theme to apply to this Activity as soon as
                 the Android process has started. This theme is visible to the user
                 while the Flutter UI initializes. After that, this theme continues
                 to determine the Window background behind the Flutter UI. --&gt;
            &lt;meta-data
              android:name=&quot;io.flutter.embedding.android.NormalTheme&quot;
              android:resource=&quot;@style/NormalTheme&quot;
              /&gt;
            &lt;intent-filter&gt;
                &lt;action android:name=&quot;android.intent.action.MAIN&quot;/&gt;
                &lt;category android:name=&quot;android.intent.category.LAUNCHER&quot;/&gt;
            &lt;/intent-filter&gt;
        &lt;/activity&gt;
        &lt;!-- Don&#39;t delete the meta-data below.
             This is used by the Flutter tool to generate GeneratedPluginRegistrant.java --&gt;
        &lt;meta-data
            android:name=&quot;flutterEmbedding&quot;
            android:value=&quot;2&quot; /&gt;
    &lt;/application&gt;
    &lt;!-- Required to query activities that can process text, see:
         https://developer.android.com/training/package-visibility and
         https://developer.android.com/reference/android/content/Intent#ACTION_PROCESS_TEXT.

         In particular, this is used by the Flutter engine in io.flutter.plugin.text.ProcessTextPlugin. --&gt;
    &lt;queries&gt;
        &lt;intent&gt;
            &lt;action android:name=&quot;android.intent.action.PROCESS_TEXT&quot;/&gt;
            &lt;data android:mimeType=&quot;text/plain&quot;/&gt;
        &lt;/intent&gt;
    &lt;/queries&gt;
&lt;/manifest&gt;
-2
Oct 31 at 7:15 PM
User AvatarRonaldo Couto
#android#flutter#dart

No answer found for this question yet.