CustomSearchField<T> constructor
CustomSearchField<T> ({
- Key? key,
- required List<
SearchFieldListItem< suggestions,T> > - bool autoCorrect = true,
- TextEditingController? controller,
- Widget emptyWidget = const SizedBox.shrink(),
- FocusNode? focusNode,
- String? hint,
- SearchFieldListItem<
T> ? initialValue, - List<
TextInputFormatter> ? inputFormatters, - TextInputType? inputType,
- double itemHeight = 35.0,
- Color? marginColor,
- int maxSuggestionsInViewPort = 5,
- bool? enabled,
- bool readOnly = false,
- dynamic onSubmit()?,
- Offset? offset,
- dynamic onSuggestionTap()?,
- InputDecoration? searchInputDecoration,
- TextStyle? searchStyle,
- bool scrollbarAlwaysVisible = true,
- TextStyle? suggestionStyle,
- BoxDecoration? suggestionsDecoration,
- SuggestionDirection suggestionDirection = SuggestionDirection.down,
- Suggestion suggestionState = Suggestion.expand,
- BoxDecoration? suggestionItemDecoration,
- SuggestionAction? suggestionAction,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextInputAction? textInputAction,
- String? validator()?,
- bool comparator()?,
- dynamic onClear()?,
Implementation
CustomSearchField(
{Key? key,
required this.suggestions,
this.autoCorrect = true,
this.controller,
this.emptyWidget = const SizedBox.shrink(),
this.focusNode,
this.hint,
this.initialValue,
this.inputFormatters,
this.inputType,
this.itemHeight = 35.0,
this.marginColor,
this.maxSuggestionsInViewPort = 5,
this.enabled,
this.readOnly = false,
this.onSubmit,
this.offset,
this.onSuggestionTap,
this.searchInputDecoration,
this.searchStyle,
this.scrollbarAlwaysVisible = true,
this.suggestionStyle,
this.suggestionsDecoration,
this.suggestionDirection = SuggestionDirection.down,
this.suggestionState = Suggestion.expand,
this.suggestionItemDecoration,
this.suggestionAction,
this.textCapitalization = TextCapitalization.none,
this.textInputAction,
this.validator,
this.comparator,
this.onClear})
:
// assert(
// (initialValue != null &&
// suggestions.containsObject(initialValue)) ||
// initialValue == null,
// 'Initial value should either be null or should be present in suggestions list.'),
super(key: key);