Add support for Android's visible password input type (flutter/engine#9999)

For framework PR https://github.com/flutter/flutter/issues/31738
This commit is contained in:
Justin McCandless
2019-07-23 07:57:39 -07:00
committed by GitHub
parent 1299da0e74
commit 1b87854bf5
2 changed files with 4 additions and 1 deletions

View File

@@ -371,7 +371,8 @@ public class TextInputChannel {
PHONE("TextInputType.phone"),
MULTILINE("TextInputType.multiline"),
EMAIL_ADDRESS("TextInputType.emailAddress"),
URL("TextInputType.url");
URL("TextInputType.url"),
VISIBLE_PASSWORD("TextInputType.visiblePassword");
static TextInputType fromValue(@NonNull String encodedName) throws NoSuchFieldException {
for (TextInputType textInputType : TextInputType.values()) {

View File

@@ -155,6 +155,8 @@ public class TextInputPlugin {
textType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
} else if (type.type == TextInputChannel.TextInputType.URL) {
textType |= InputType.TYPE_TEXT_VARIATION_URI;
} else if (type.type == TextInputChannel.TextInputType.VISIBLE_PASSWORD) {
textType |= InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
}
if (obscureText) {