Add autofill support to ios text input plugin#17493
Add autofill support to ios text input plugin#17493LongCatIsLooong merged 13 commits intoflutter:masterfrom
Conversation
5366c54 to
0d195a6
Compare
0b7faea to
e87f36f
Compare
600d9f7 to
c306f8c
Compare
| } | ||
|
|
||
| - (void)updateEditingClient:(int)client withState:(NSDictionary*)state withTag:(NSString*)tag { | ||
| [_textInputChannel.get() invokeMethod:@"TextInputClient.updateEditingStateWithTag" |
There was a problem hiding this comment.
This would be safer if you used performSelector:withObject:withObject: https://developer.apple.com/documentation/objectivec/1418956-nsobject/1418667-performselector?language=objc
That will give you static analysis that the method you are invoking exists.
There was a problem hiding this comment.
I think @"TextInputClient.updateEditingStateWithTag" does not represent an objective-c selector but a platform message (that will be received and handled by some dart code)?
| #include "flutter/shell/platform/darwin/common/framework/Headers/FlutterChannels.h" | ||
| #include "flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputDelegate.h" | ||
|
|
||
| #if FLUTTER_RUNTIME_MODE == FLUTTER_RUNTIME_MODE_DEBUG |
There was a problem hiding this comment.
I was talking about the "FLUTTER_EXPORT" not being needed once that lands. We used to have to export things we wanted to tests, now tests live with the code so it isn't necessary.
gaaclarke
left a comment
There was a problem hiding this comment.
Please date the PR with a more descriptive title.
| } | ||
|
|
||
| - (void)setAutofillId:(NSString*)autofillId { | ||
| _autofillId = [autofillId copy]; |
There was a problem hiding this comment.
This doesn't release the old value. Instead of writing this you can just do@property(nonatomic, copy) NSString* autofillId to have one automatically generated. Put it in the .mm file to make it private.
There was a problem hiding this comment.
Thank you for the review! I have to put the interface in the header file in order to be able to import that in a unit test (at least for now). Does adding autorelease after copy work here too?
There was a problem hiding this comment.
Oh your pull request is already merged. I guess that means I can move the interface back to the .mm file?
There was a problem hiding this comment.
Yep, autorelease can be used on any object.
| } else { | ||
| _activeView = _view; | ||
| NSAssert(clientUniqueId != nil, @"The client's unique id can't be null"); | ||
| for (FlutterTextInputView* v in _inputViews) |
There was a problem hiding this comment.
for (int i = 0; i < 10; i++)
BlowTheHorn(); // AVOID.
http://google.github.io/styleguide/objcguide.html#conditionals
gaaclarke
left a comment
There was a problem hiding this comment.
Sorry i didn't put all my comments all together in one review, i'm done now =)
a38471f to
ca9262e
Compare
ca9262e to
bec64d3
Compare
gaaclarke
left a comment
There was a problem hiding this comment.
I just threw on a change with my outstanding comments into a patch. LGTM now.
Framework PR: flutter/flutter#52126
Moved
FlutterTextInputView's interface to the header file in order to expose it in unit tests.