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

Commit 104df6b

Browse files
Add autofill support to ios text input plugin (#17493)
1 parent 82fec3e commit 104df6b

File tree

5 files changed

+304
-49
lines changed

5 files changed

+304
-49
lines changed

shell/platform/darwin/ios/framework/Source/FlutterEngine.mm

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -534,6 +534,11 @@ - (void)updateEditingClient:(int)client withState:(NSDictionary*)state {
534534
arguments:@[ @(client), state ]];
535535
}
536536

537+
- (void)updateEditingClient:(int)client withState:(NSDictionary*)state withTag:(NSString*)tag {
538+
[_textInputChannel.get() invokeMethod:@"TextInputClient.updateEditingStateWithTag"
539+
arguments:@[ @(client), @{tag : state} ]];
540+
}
541+
537542
- (void)updateFloatingCursor:(FlutterFloatingCursorDragState)state
538543
withClient:(int)client
539544
withPosition:(NSDictionary*)position {

shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ typedef NS_ENUM(NSInteger, FlutterFloatingCursorDragState) {
3030
@protocol FlutterTextInputDelegate <NSObject>
3131

3232
- (void)updateEditingClient:(int)client withState:(NSDictionary*)state;
33+
- (void)updateEditingClient:(int)client withState:(NSDictionary*)state withTag:(NSString*)tag;
3334
- (void)performAction:(FlutterTextInputAction)action withClient:(int)client;
3435
- (void)updateFloatingCursor:(FlutterFloatingCursorDragState)state
3536
withClient:(int)client

shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,6 @@
3636
@end
3737

3838
/** A range of text in the buffer of a Flutter text editing widget. */
39-
#if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG
40-
FLUTTER_EXPORT
41-
#endif
4239
@interface FlutterTextRange : UITextRange <NSCopying>
4340

4441
@property(nonatomic, readonly) NSRange range;
@@ -71,6 +68,7 @@ FLUTTER_EXPORT
7168
@property(nonatomic, getter=isSecureTextEntry) BOOL secureTextEntry;
7269
@property(nonatomic) UITextSmartQuotesType smartQuotesType API_AVAILABLE(ios(11.0));
7370
@property(nonatomic) UITextSmartDashesType smartDashesType API_AVAILABLE(ios(11.0));
71+
@property(nonatomic, copy) UITextContentType textContentType API_AVAILABLE(ios(10.0));
7472

7573
@property(nonatomic, assign) id<FlutterTextInputDelegate> textInputDelegate;
7674

0 commit comments

Comments
 (0)