EasyAutocomplete constructor
const
EasyAutocomplete({
- List<
String> ? suggestions, - Future<
List< asyncSuggestions(String> >- String searchValue
- Widget suggestionBuilder(
- String data
- TextEditingController? controller,
- InputDecoration decoration = const InputDecoration(),
- dynamic onChanged()?,
- dynamic onSubmitted()?,
- List<
TextInputFormatter> inputFormatter = const [], - String? initialValue,
- bool autofocus = false,
- TextCapitalization textCapitalization = TextCapitalization.sentences,
- TextInputType keyboardType = TextInputType.text,
- FocusNode? focusNode,
- Color? cursorColor,
- TextStyle inputTextStyle = const TextStyle(),
- TextStyle suggestionTextStyle = const TextStyle(),
- Color? suggestionBackgroundColor,
- Duration debounceDuration = const Duration(milliseconds: 400),
Creates a autocomplete widget to help you manage your suggestions
Implementation
const EasyAutocomplete(
{this.suggestions,
this.asyncSuggestions,
this.suggestionBuilder,
this.controller,
this.decoration = const InputDecoration(),
this.onChanged,
this.onSubmitted,
this.inputFormatter = const [],
this.initialValue,
this.autofocus = false,
this.textCapitalization = TextCapitalization.sentences,
this.keyboardType = TextInputType.text,
this.focusNode,
this.cursorColor,
this.inputTextStyle = const TextStyle(),
this.suggestionTextStyle = const TextStyle(),
this.suggestionBackgroundColor,
this.debounceDuration = const Duration(milliseconds: 400)})
: assert(onChanged != null || controller != null,
'onChanged and controller parameters cannot be both null at the same time'),
assert(!(controller != null && initialValue != null),
'controller and initialValue cannot be used at the same time'),
assert(
suggestions != null && asyncSuggestions == null ||
suggestions == null && asyncSuggestions != null,
'suggestions and asyncSuggestions cannot be both null or have values at the same time');