Add support for TextInputType.url (flutter/engine#3730)
Adds support for requesting a platform keyboard optimised for entering URLs.
This commit is contained in:
@@ -84,6 +84,8 @@ public class TextInputPlugin implements MethodCallHandler {
|
||||
int textType = InputType.TYPE_CLASS_TEXT;
|
||||
if (inputType.equals("TextInputType.emailAddress"))
|
||||
textType |= InputType.TYPE_TEXT_VARIATION_EMAIL_ADDRESS;
|
||||
else if (inputType.equals("TextInputType.url"))
|
||||
textType |= InputType.TYPE_TEXT_VARIATION_URI;
|
||||
if (obscureText)
|
||||
textType |= InputType.TYPE_TEXT_FLAG_NO_SUGGESTIONS;
|
||||
return textType;
|
||||
|
||||
@@ -18,6 +18,8 @@ static UIKeyboardType ToUIKeyboardType(NSString* inputType) {
|
||||
return UIKeyboardTypePhonePad;
|
||||
if ([inputType isEqualToString:@"TextInputType.emailAddress"])
|
||||
return UIKeyboardTypeEmailAddress;
|
||||
if ([inputType isEqualToString:@"TextInputType.url"])
|
||||
return UIKeyboardTypeURL;
|
||||
return UIKeyboardTypeDefault;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user