Improvements to SearchDelegate (#91982)

This commit is contained in:
Prateek Sunal
2022-04-30 00:54:08 +05:30
committed by GitHub
parent 6ce794e034
commit 99769b0f89
2 changed files with 6 additions and 1 deletions

View File

@@ -581,7 +581,7 @@ class _SearchPageState<T> extends State<_SearchPage<T>> {
title: TextField(
controller: widget.delegate._queryTextController,
focusNode: focusNode,
style: theme.textTheme.headline6,
style: widget.delegate.searchFieldStyle ?? theme.textTheme.headline6,
textInputAction: widget.delegate.textInputAction,
keyboardType: widget.delegate.keyboardType,
onSubmitted: (String _) {

View File

@@ -554,8 +554,13 @@ void main() {
await tester.pumpAndSettle();
final Text hintText = tester.widget(find.text(searchHintText));
final TextField textField = tester.widget<TextField>(find.byType(TextField));
expect(hintText.style?.color, delegate.searchFieldStyle?.color);
expect(hintText.style?.fontSize, delegate.searchFieldStyle?.fontSize);
expect(textField.style?.color, delegate.searchFieldStyle?.color);
expect(textField.style?.fontSize, delegate.searchFieldStyle?.fontSize);
});
testWidgets('keyboard show search button by default', (WidgetTester tester) async {