这是indexloc提供的服务,不要输入任何密码
Skip to content

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

Merged
merged 1 commit into from
Aug 11, 2020

Conversation

guolinaileen
Copy link
Contributor

@guolinaileen guolinaileen commented Aug 1, 2020

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.

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I signed the CLA.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I updated/added relevant documentation (doc comments with ///).
  • All existing and new tests are passing.
  • The analyzer (flutter analyze --flutter-repo) does not report any problems on my PR.
  • I am willing to follow-up on review comments in a timely manner.

Breaking Change

Did any tests fail when you ran them? Please read Handling breaking changes.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Aug 1, 2020
@guolinaileen
Copy link
Contributor Author

@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 {
Copy link
Contributor Author

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.

Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@justinmc justinmc left a 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.

Copy link
Member

@goderbauer goderbauer left a 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.
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@justinmc
Copy link
Contributor

justinmc commented Aug 8, 2020

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 (No gradle daemons running), but maybe that will fix it.

Copy link
Contributor

@justinmc justinmc left a 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.

@justinmc
Copy link
Contributor

Looks like the tests are passing! This will be merged when our build is fixed.

@guolinaileen
Copy link
Contributor Author

Looks like the tests are passing! This will be merged when our build is fixed.

Thanks, Justin!

@fluttergithubbot fluttergithubbot merged commit cbe0999 into flutter:master Aug 11, 2020
mingwandroid pushed a commit to mingwandroid/flutter that referenced this pull request Sep 6, 2020
/// {@template flutter.widgets.editableText.onAppPrivateCommand}
/// Called when the result of an app private command is received.
/// {@endtemplate}
final AppPrivateCommandCallback onAppPrivateCommand;
Copy link
Contributor

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. :-)

Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants