简体   繁体   中英

Flutter TextField Keyboard type does not work on ios

The Keyboard type property is not changing the appearance of the keyboard on ios. It is working fine on android and was also working properly on ios until it suddenly started to show the same keyboard regardless of setting the keyboard type property on a text field.

here is the text field:

TextFormField(
                  keyboardType: TextInputType.emailAddress,
                  initialValue: _loginValues['email'],
                  focusNode: _emailFocusNode,
                  textInputAction: TextInputAction.next,
                  onFieldSubmitted: (_) => FocusScope.of(context)
                      .requestFocus(_passwordFocusNode),
                  validator: (value) {
                    if (value.isEmpty) {
                      return 'Agrega un correo electronico por favor';
                    }
                    return null;
                  },
                  onSaved: (value) {
                    _loginValues['email'] = value;
                  },
                  cursorColor: Theme.of(context).accentColor,
                  
                ),

the keyboard that shows up is this: Keyboard keyboard for email input

Also, I get the same keyboard not matter what keyboard property I set

Output of flutter doctor:

✓] Flutter (Channel master, 1.21.0-6.0.pre.141, on Mac OS X 10.15.5 19F101, locale en-US)
• Flutter version 1.21.0-6.0.pre.141 at /Users/santiagoracca/flutter
• Framework revision c748f1a7aa (21 hours ago), 2020-07-31 17:45:18 -0700
• Engine revision 280bbfc763
• Dart version 2.10.0 (build 2.10.0-2.0.dev bd528bfbd6)



[✓] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
    • Android SDK at /Users/santiagoracca/Library/Android/sdk
    • Platform android-29, build-tools 28.0.3
    • Java binary at: /Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 11.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Xcode 11.3.1, Build version 11C505
    • CocoaPods version 1.9.3

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 3.6)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin version 45.1.1
    • Dart plugin version 192.7761
    • Java version OpenJDK Runtime Environment (build 1.8.0_212-release-1586-b4-5784211)

[✓] VS Code (version 1.47.3)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.13.1

[✓] Connected device (3 available)
    • iPhone (mobile)  • e0bc74dd38d4efaa541b9174cfb54bbd3044fce5 • ios            • iOS 12.4.7
    • Web Server (web) • web-server                               • web-javascript • Flutter Tools
    • Chrome (web)     • chrome                                   • web-javascript • Google Chrome 84.0.4147.105
**strong text**
• No issues found!

I came across a similar issue, and I was able to fix it by switching to the stable channel of Flutter.

flutter channel stable

Also, make sure to upgrade to the latest version of Flutter by running this command

flutter upgrade

These are the commands you can run to fix the issue. Let me know if it fixes it. Thanks

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM