CustomSearchField<T> constructor

CustomSearchField<T>({
  1. Key? key,
  2. required List<SearchFieldListItem<T>> suggestions,
  3. bool autoCorrect = true,
  4. TextEditingController? controller,
  5. Widget emptyWidget = const SizedBox.shrink(),
  6. FocusNode? focusNode,
  7. String? hint,
  8. SearchFieldListItem<T>? initialValue,
  9. List<TextInputFormatter>? inputFormatters,
  10. TextInputType? inputType,
  11. double itemHeight = 35.0,
  12. Color? marginColor,
  13. int maxSuggestionsInViewPort = 5,
  14. bool? enabled,
  15. bool readOnly = false,
  16. dynamic onSubmit(
    1. String
    )?,
  17. Offset? offset,
  18. dynamic onSuggestionTap(
    1. SearchFieldListItem<T>
    )?,
  19. InputDecoration? searchInputDecoration,
  20. TextStyle? searchStyle,
  21. bool scrollbarAlwaysVisible = true,
  22. TextStyle? suggestionStyle,
  23. BoxDecoration? suggestionsDecoration,
  24. SuggestionDirection suggestionDirection = SuggestionDirection.down,
  25. Suggestion suggestionState = Suggestion.expand,
  26. BoxDecoration? suggestionItemDecoration,
  27. SuggestionAction? suggestionAction,
  28. TextCapitalization textCapitalization = TextCapitalization.none,
  29. TextInputAction? textInputAction,
  30. String? validator(
    1. String?
    )?,
  31. bool comparator(
    1. String inputText,
    2. String suggestionKey
    )?,
  32. 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);