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.

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.keyboardType,
  this.textInputAction = TextInputAction.search,
});