Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ static UITextAutocapitalizationType ToUITextAutoCapitalizationType(NSDictionary*
return UITextAutocapitalizationTypeNone;
}

@available iOS (11.0,*)
static UITextContentType ToUITextContentType(NSDictionary* type) {
NSString* contentType = type[@"textType"];
if ([contentType isEqualToString:@"TextContent.username"])
return UITextContentTypeUsername;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The above 3 lines have indentation problems. Indentation should be 2 spaces.

}

static UIReturnKeyType ToUIReturnKeyType(NSString* inputType) {
// Where did the term "unspecified" come from? iOS has a "default" and Android
// has "unspecified." These 2 terms seem to mean the same thing but we need
Expand Down Expand Up @@ -149,6 +156,13 @@ @interface FlutterTextInputView : UIView <UITextInput>
@property(nonatomic, strong) UITextRange* markedTextRange;
@property(nonatomic, copy) NSDictionary* markedTextStyle;
@property(nonatomic, assign) id<UITextInputDelegate> inputDelegate;
/**
This file is to make ios 11 or higher device using autofill

Reference to github.com/flutter/flutter/issues/33040
**/
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove this doc comment since it doesn't add anything that the reader can't look up from UITextContentType or the commit comment from git blame.

@property(nonatomic) UITextContentType textContentType API_AVAILABLE(ios(11.0));


// UITextInputTraits
@property(nonatomic) UITextAutocapitalizationType autocapitalizationType;
Expand Down Expand Up @@ -191,6 +205,8 @@ - (instancetype)init {
_enablesReturnKeyAutomatically = NO;
_keyboardAppearance = UIKeyboardAppearanceDefault;
_keyboardType = UIKeyboardTypeDefault;
if(@available iOS (11.0,*))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax above should be: if (@available(iOS 11.0, *))

_keyboardContentType = UITextContentType;
_returnKeyType = UIReturnKeyDone;
_secureTextEntry = NO;
}
Expand Down Expand Up @@ -754,6 +770,8 @@ - (void)hideTextInput {

- (void)setTextInputClient:(int)client withConfiguration:(NSDictionary*)configuration {
NSDictionary* inputType = configuration[@"inputType"];
if(@available iOS (11.0,*))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax above should be: if (@available(iOS 11.0, *))

NSDictionary* contentType = configuration[@"contentType"];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is an unused variable.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This variable is referred by flutter/flutter#33040

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this is an unused variable.

Maybe I will check CI After Exam Month

NSString* keyboardAppearance = configuration[@"keyboardAppearance"];
if ([configuration[@"obscureText"] boolValue]) {
_activeView = _secureView;
Expand All @@ -762,6 +780,8 @@ - (void)setTextInputClient:(int)client withConfiguration:(NSDictionary*)configur
}

_activeView.keyboardType = ToUIKeyboardType(inputType);
if(@available iOS (11.0,*))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The syntax above should be: if (@available(iOS 11.0, *))

_activeView.textContentType = ToUITextContentType(contentType);
_activeView.returnKeyType = ToUIReturnKeyType(configuration[@"inputAction"]);
_activeView.autocapitalizationType = ToUITextAutoCapitalizationType(configuration);
if ([keyboardAppearance isEqualToString:@"Brightness.dark"]) {
Expand Down