EasyAutocomplete constructor

const EasyAutocomplete({
  1. List<String>? suggestions,
  2. Future<List<String>> asyncSuggestions(
    1. String searchValue
    )?,
  3. Widget suggestionBuilder(
    1. String data
    )?,
  4. TextEditingController? controller,
  5. InputDecoration decoration = const InputDecoration(),
  6. dynamic onChanged(
    1. String
    )?,
  7. dynamic onSubmitted(
    1. String
    )?,
  8. List<TextInputFormatter> inputFormatter = const [],
  9. String? initialValue,
  10. bool autofocus = false,
  11. TextCapitalization textCapitalization = TextCapitalization.sentences,
  12. TextInputType keyboardType = TextInputType.text,
  13. FocusNode? focusNode,
  14. Color? cursorColor,
  15. TextStyle inputTextStyle = const TextStyle(),
  16. TextStyle suggestionTextStyle = const TextStyle(),
  17. Color? suggestionBackgroundColor,
  18. 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');