SearchDelegate<T> constructor
- {String searchFieldLabel,
- TextStyle searchFieldStyle,
- TextInputType keyboardType,
- TextInputAction textInputAction: TextInputAction.search}
Constructor to be called by subclasses which may specify searchFieldLabel
, keyboardType
and/or
textInputAction
.
class CustomSearchHintDelegate extends SearchDelegate {
CustomSearchHintDelegate({
String hintText,
}) : super(
searchFieldLabel: hintText,
keyboardType: TextInputType.text,
textInputAction: TextInputAction.search,
);
@override
Widget buildLeading(BuildContext context) => Text("leading");
@override
Widget buildSuggestions(BuildContext context) => Text("suggestions");
@override
Widget buildResults(BuildContext context) => Text('results');
@override
List<Widget> buildActions(BuildContext context) => [];
}
Implementation
SearchDelegate({
this.searchFieldLabel,
this.searchFieldStyle,
this.keyboardType,
this.textInputAction = TextInputAction.search,
});