SearchField<T> constructor

SearchField<T>({
  1. Key? key,
  2. required List<SearchFieldListItem<T>> suggestions,
  3. Duration animationDuration = const Duration(milliseconds: 300),
  4. bool autoCorrect = true,
  5. bool autofocus = false,
  6. AutovalidateMode? autovalidateMode,
  7. TextEditingController? controller,
  8. Widget emptyWidget = const SizedBox(),
  9. bool? enabled,
  10. FocusNode? focusNode,
  11. String? hint,
  12. SearchFieldListItem<T>? initialValue,
  13. List<TextInputFormatter>? inputFormatters,
  14. TextInputType? inputType,
  15. double itemHeight = 35.0,
  16. Color? marginColor,
  17. int maxSuggestionsInViewPort = 5,
  18. bool readOnly = false,
  19. List<SearchFieldListItem<T>>? onSearchTextChanged(
    1. String
    )?,
  20. void onSaved(
    1. String?
    )?,
  21. void onScroll(
    1. double,
    2. double
    )?,
  22. void onTap()?,
  23. dynamic onSubmit(
    1. String
    )?,
  24. void onTapOutside(
    1. PointerDownEvent
    )?,
  25. Offset? offset,
  26. dynamic onSuggestionTap(
    1. SearchFieldListItem<T>
    )?,
  27. InputDecoration? searchInputDecoration,
  28. TextStyle? searchStyle,
  29. ScrollbarDecoration? scrollbarDecoration,
  30. bool showEmpty = false,
  31. TextStyle? suggestionStyle,
  32. SuggestionDecoration? suggestionsDecoration,
  33. SuggestionDirection suggestionDirection = SuggestionDirection.down,
  34. Suggestion suggestionState = Suggestion.expand,
  35. BoxDecoration? suggestionItemDecoration,
  36. SuggestionAction? suggestionAction,
  37. TextAlign textAlign = TextAlign.start,
  38. TextCapitalization textCapitalization = TextCapitalization.none,
  39. TextInputAction? textInputAction,
  40. String? validator(
    1. String?
    )?,
})

Implementation

SearchField({
  Key? key,
  required this.suggestions,
  this.animationDuration = const Duration(milliseconds: 300),
  this.autoCorrect = true,
  this.autofocus = false,
  this.autovalidateMode,
  this.controller,
  this.emptyWidget = const SizedBox(),
  this.enabled,
  this.focusNode,
  this.hint,
  this.initialValue,
  this.inputFormatters,
  this.inputType,
  this.itemHeight = 35.0,
  this.marginColor,
  this.maxSuggestionsInViewPort = 5,
  this.readOnly = false,
  this.onSearchTextChanged,
  this.onSaved,
  this.onScroll,
  this.onTap,
  this.onSubmit,
  this.onTapOutside,
  this.offset,
  this.onSuggestionTap,
  this.searchInputDecoration,
  this.searchStyle,
  this.scrollbarDecoration,
  this.showEmpty = false,
  this.suggestionStyle,
  this.suggestionsDecoration,
  this.suggestionDirection = SuggestionDirection.down,
  this.suggestionState = Suggestion.expand,
  this.suggestionItemDecoration,
  this.suggestionAction,
  this.textAlign = TextAlign.start,
  this.textCapitalization = TextCapitalization.none,
  this.textInputAction,
  this.validator,
})  : assert(
          (initialValue != null &&
                  suggestions.containsObject(initialValue)) ||
              initialValue == null,
          'Initial value should either be null or should be present in suggestions list.'),
      super(key: key);