diff --git a/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java b/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java index 8898b2b4c40..5d78c6787f1 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java @@ -77,7 +77,9 @@ public class TextInputPlugin implements MethodCallHandler { } } - private static int inputTypeFromTextInputType(String inputType, boolean obscureText) { + private static int inputTypeFromTextInputType(String inputType, + boolean obscureText, + boolean noAutoCorrect) { if (inputType.equals("TextInputType.datetime")) return InputType.TYPE_CLASS_DATETIME; if (inputType.equals("TextInputType.number")) @@ -94,6 +96,8 @@ public class TextInputPlugin implements MethodCallHandler { // Note: both required. Some devices ignore TYPE_TEXT_FLAG_NO_SUGGESTIONS. textType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS; textType |= InputType.TYPE_TEXT_VARIATION_PASSWORD; + } else if (!noAutoCorrect) { + textType |= InputType.TYPE_TEXT_FLAG_AUTO_CORRECT; } return textType; } @@ -103,8 +107,10 @@ public class TextInputPlugin implements MethodCallHandler { if (mClient == 0) return null; - outAttrs.inputType = inputTypeFromTextInputType(mConfiguration.getString("inputType"), - mConfiguration.optBoolean("obscureText")); + outAttrs.inputType = inputTypeFromTextInputType( + mConfiguration.getString("inputType"), + mConfiguration.optBoolean("obscureText"), + mConfiguration.optBoolean("noAutoCorrect")); if (!mConfiguration.isNull("actionLabel")) outAttrs.actionLabel = mConfiguration.getString("actionLabel"); outAttrs.imeOptions = EditorInfo.IME_ACTION_DONE | EditorInfo.IME_FLAG_NO_FULLSCREEN;