-
Notifications
You must be signed in to change notification settings - Fork 28.9k
Add onAppPrivateCommand to TextField #62712
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
@goderbauer @justinmc @xster Please take a look. |
@@ -26,40 +27,53 @@ void main() { | |||
TextInput.setChannel(SystemChannels.textInput); | |||
}); | |||
|
|||
test('text input client handler responds to reattach with setClient', () async { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've ran "flutter format" to format this file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The flutter framework does not use use formatter, see https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#formatting. Can you please undo the unrelated format changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a small formatting fix. Let me know if the tests won't go green.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approach looks fine, I leave it to @justinmc for the final review.
@@ -1030,6 +1034,9 @@ class EditableText extends StatefulWidget { | |||
/// {@end-tool} | |||
final ValueChanged<String> onSubmitted; | |||
|
|||
/// Called when receives the app private command. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Called when the result of an app private command is received?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
I'm also not having any luck getting these last tests to go green. @guolinaileen could you try merging in master again? It looks like an infrastructure problem ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, we just need to get the tests to go green.
Typically I would want to add new API to TextFormField and CupertinoTextField too, but I think it's fine for a niche thing like this. If anyone has a use for it, we can add it separately.
f070b44
to
9b4f3be
Compare
fc8d0ed
to
6de0b08
Compare
Looks like the tests are passing! This will be merged when our build is fixed. |
Thanks, Justin! |
/// {@template flutter.widgets.editableText.onAppPrivateCommand} | ||
/// Called when the result of an app private command is received. | ||
/// {@endtemplate} | ||
final AppPrivateCommandCallback onAppPrivateCommand; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any chance we can have this documentation elaborated? It doesn't really follow our style guide, which requires that documentation be more detailed than could be guessed just from the name. :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good call, I'll open a quick PR to elaborate on this.
Description
Add onAppPrivateCommand to TextField
Related Issues
This PR is part of introducing sendAppPrivateCommand and onAppPrivateCommand APIs.
Tests
I added the following tests:
TextInputClient performPrivateCommand method is called
Checklist
Before you create this PR, confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze --flutter-repo
) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.