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

update SearchDelegate's leading and actions widgets can be null #80006

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 3 commits into from
Apr 13, 2021

Conversation

xu-baolin
Copy link
Member

@xu-baolin xu-baolin commented Apr 8, 2021

Fixes #78144
The documentation says that they can be null.

  /// Widgets to display after the search query in the [AppBar].
  ///
  /// If the [query] is not empty, this should typically contain a button to
  /// clear the query and show the suggestions again (via [showSuggestions]) if
  /// the results are currently shown.
  ///
  /// Returns null if no widget should be shown.
  ///
  /// See also:
  ///
  ///  * [AppBar.actions], the intended use for the return value of this method.

@flutter-dashboard flutter-dashboard bot added f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels. labels Apr 8, 2021
@google-cla google-cla bot added the cla: yes label Apr 8, 2021
@xu-baolin xu-baolin requested a review from shihaohong April 8, 2021 02:55
await tester.tap(find.byTooltip('Search'));
await tester.pumpAndSettle();

expect(tester.takeException(), isNull);
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this just mean that no exceptions were thrown? Maybe add one more step to the test here to show that the search delegate page is displayed instead of checking that no exceptions were thrown. Then, add a comment saying something like "The search delegate page is displayed with no issues even with a null return values for [buildLeading] and [buildActions]".

Copy link
Member Author

Choose a reason for hiding this comment

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

make sense

Copy link
Contributor

@shihaohong shihaohong left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for the updated test!

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.

SearchDelegate#buildLeading should return Widget?
3 participants