@@ -119,6 +119,7 @@ abstract class SearchDelegate<T> {
119
119
/// {@end-tool}
120
120
SearchDelegate ({
121
121
this .searchFieldLabel,
122
+ this .searchFieldStyle,
122
123
this .keyboardType,
123
124
this .textInputAction = TextInputAction .search,
124
125
});
@@ -264,6 +265,11 @@ abstract class SearchDelegate<T> {
264
265
/// If this value is set to null, the value of MaterialLocalizations.of(context).searchFieldLabel will be used instead.
265
266
final String searchFieldLabel;
266
267
268
+ /// The style of the [searchFieldLabel] .
269
+ ///
270
+ /// If this value is set to null, the value of the ambient [Theme] 's [ThemeData.inputDecorationTheme.hintStyle] will be used instead.
271
+ final TextStyle searchFieldStyle;
272
+
267
273
/// The type of action button to use for the keyboard.
268
274
///
269
275
/// Defaults to the default value specified in [TextField] .
@@ -315,7 +321,6 @@ enum _SearchBody {
315
321
results,
316
322
}
317
323
318
-
319
324
class _SearchPageRoute <T > extends PageRoute <T > {
320
325
_SearchPageRoute ({
321
326
@required this .delegate,
@@ -469,6 +474,8 @@ class _SearchPageState<T> extends State<_SearchPage<T>> {
469
474
final ThemeData theme = widget.delegate.appBarTheme (context);
470
475
final String searchFieldLabel = widget.delegate.searchFieldLabel
471
476
?? MaterialLocalizations .of (context).searchFieldLabel;
477
+ final TextStyle searchFieldStyle = widget.delegate.searchFieldStyle
478
+ ?? theme.inputDecorationTheme.hintStyle;
472
479
Widget body;
473
480
switch (widget.delegate._currentBody) {
474
481
case _SearchBody .suggestions:
@@ -521,7 +528,7 @@ class _SearchPageState<T> extends State<_SearchPage<T>> {
521
528
decoration: InputDecoration (
522
529
border: InputBorder .none,
523
530
hintText: searchFieldLabel,
524
- hintStyle: theme.inputDecorationTheme.hintStyle ,
531
+ hintStyle: searchFieldStyle ,
525
532
),
526
533
),
527
534
actions: widget.delegate.buildActions (context),
0 commit comments