RawAutocomplete<T extends Object> constructor
- Key? key,
- required AutocompleteOptionsViewBuilder<
T> optionsViewBuilder, - required AutocompleteOptionsBuilder<
T> optionsBuilder, - OptionsViewOpenDirection optionsViewOpenDirection = OptionsViewOpenDirection.down,
- AutocompleteOptionToString<
T> displayStringForOption = defaultStringForOption, - AutocompleteFieldViewBuilder? fieldViewBuilder,
- FocusNode? focusNode,
- AutocompleteOnSelected<
T> ? onSelected, - TextEditingController? textEditingController,
- 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.',
);