Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 4decc17

Browse files
authored
Add support for Android's visible password input type (#9999)
For framework PR flutter/flutter#31738
1 parent 7d320c4 commit 4decc17

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

‎shell/platform/android/io/flutter/embedding/engine/systemchannels/TextInputChannel.java‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ public enum TextInputType {
371371
PHONE("TextInputType.phone"),
372372
MULTILINE("TextInputType.multiline"),
373373
EMAIL_ADDRESS("TextInputType.emailAddress"),
374-
URL("TextInputType.url");
374+
URL("TextInputType.url"),
375+
VISIBLE_PASSWORD("TextInputType.visiblePassword");
375376

376377
static TextInputType fromValue(@NonNull String encodedName) throws NoSuchFieldException {
377378
for (TextInputType textInputType : TextInputType.values()) {

‎shell/platform/android/io/flutter/plugin/editing/TextInputPlugin.java‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ private static int inputTypeFromTextInputType(
155155
textType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
156156
} else if (type.type == TextInputChannel.TextInputType.URL) {
157157
textType |= InputType.TYPE_TEXT_VARIATION_URI;
158+
} else if (type.type == TextInputChannel.TextInputType.VISIBLE_PASSWORD) {
159+
textType |= InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD;
158160
}
159161

160162
if (obscureText) {

0 commit comments

Comments
 (0)