SearchDelegate<T> constructor
SearchDelegate<T> ({
- String? searchFieldLabel,
- TextInputType? keyboardType,
- TextInputAction textInputAction = TextInputAction.search,
Constructor to be called by subclasses which may specify searchFieldLabel, keyboardType and/or textInputAction.
{@tool sample}
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) => [];
}
{@end-tool}
Implementation
SearchDelegate({
this.searchFieldLabel,
this.keyboardType,
this.textInputAction = TextInputAction.search,
});