RawAutocomplete<T extends Object> constructor

const RawAutocomplete<T extends Object>(
  1. {Key? key,
  2. required AutocompleteOptionsViewBuilder<T> optionsViewBuilder,
  3. required AutocompleteOptionsBuilder<T> optionsBuilder,
  4. OptionsViewOpenDirection optionsViewOpenDirection = OptionsViewOpenDirection.down,
  5. AutocompleteOptionToString<T> displayStringForOption = defaultStringForOption,
  6. AutocompleteFieldViewBuilder? fieldViewBuilder,
  7. FocusNode? focusNode,
  8. AutocompleteOnSelected<T>? onSelected,
  9. TextEditingController? textEditingController,
  10. TextEditingValue? initialValue}
)

Create an instance of RawAutocomplete.

displayStringForOption, optionsBuilder and optionsViewBuilder must not be null.

Implementation

const RawAutocomplete({
  super.key,
  required this.optionsViewBuilder,
  required this.optionsBuilder,
  this.optionsViewOpenDirection = OptionsViewOpenDirection.down,
  this.displayStringForOption = defaultStringForOption,
  this.fieldViewBuilder,
  this.focusNode,
  this.onSelected,
  this.textEditingController,
  this.initialValue,
}) : assert(
       fieldViewBuilder != null
          || (key != null && focusNode != null && textEditingController != null),
       'Pass in a fieldViewBuilder, or otherwise create a separate field and pass in the FocusNode, TextEditingController, and a key. Use the key with RawAutocomplete.onFieldSubmitted.',
      ),
     assert((focusNode == null) == (textEditingController == null)),
     assert(
       !(textEditingController != null && initialValue != null),
       'textEditingController and initialValue cannot be simultaneously defined.',
     );