FluentAutoSuggestBox<T> constructor

FluentAutoSuggestBox<T>({
  1. Key? key,
  2. required List<FluentAutoSuggestBoxItem<T>> items,
  3. TextEditingController? controller,
  4. AutoSuggestController<T>? autoSuggestController,
  5. OnTextChanged<T>? onChanged,
  6. ValueChanged<FluentAutoSuggestBoxItem<T>?>? onSelected,
  7. ValueChanged<bool>? onOverlayVisibilityChanged,
  8. ItemBuilder<T>? itemBuilder,
  9. WidgetBuilder? noResultsFoundBuilder,
  10. WidgetBuilder? loadingBuilder,
  11. ItemSorter<T>? sorter,
  12. Widget? trailingIcon,
  13. bool clearButtonEnabled = true,
  14. TextStyle? style,
  15. InputDecoration? decoration,
  16. Color? cursorColor,
  17. double? cursorHeight,
  18. Radius cursorRadius = const Radius.circular(2.0),
  19. double cursorWidth = 1.5,
  20. bool? showCursor,
  21. Brightness? keyboardAppearance,
  22. EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
  23. BoxHeightStyle selectionHeightStyle = ui.BoxHeightStyle.tight,
  24. BoxWidthStyle selectionWidthStyle = ui.BoxWidthStyle.tight,
  25. TextInputAction? textInputAction,
  26. FocusNode? focusNode,
  27. bool autofocus = false,
  28. bool enableKeyboardControls = true,
  29. bool enabled = true,
  30. bool readOnly = false,
  31. List<TextInputFormatter>? inputFormatters,
  32. double maxPopupHeight = kDefaultMaxPopupHeight,
  33. Future<List<FluentAutoSuggestBoxItem<T>>> onNoResultsFound(
    1. String
    )?,
  34. void onError(
    1. Object error,
    2. StackTrace stack
    )?,
  35. double tileHeight = kDefaultItemHeight,
  36. AutoSuggestBoxDirection direction = AutoSuggestBoxDirection.below,
  37. TextInputType keyboardType = TextInputType.text,
  38. int? maxLength,
  39. Offset? offset,
  40. VoidCallback? onEditingComplete,
  41. bool enableCache = true,
  42. int cacheMaxSize = 100,
  43. Duration cacheDuration = const Duration(minutes: 30),
  44. Duration debounceDelay = const Duration(milliseconds: 300),
  45. int minSearchLength = 2,
})

Creates a fluent-styled auto suggest box

Implementation

FluentAutoSuggestBox({
  super.key,
  required List<FluentAutoSuggestBoxItem<T>> items,
  this.controller,
  this.autoSuggestController,
  this.onChanged,
  this.onSelected,
  this.onOverlayVisibilityChanged,
  this.itemBuilder,
  this.noResultsFoundBuilder,
  this.loadingBuilder,
  this.sorter,
  this.trailingIcon,
  this.clearButtonEnabled = true,
  this.style,
  this.decoration,
  this.cursorColor,
  this.cursorHeight,
  this.cursorRadius = const Radius.circular(2.0),
  this.cursorWidth = 1.5,
  this.showCursor,
  this.keyboardAppearance,
  this.scrollPadding = const EdgeInsets.all(20.0),
  this.selectionHeightStyle = ui.BoxHeightStyle.tight,
  this.selectionWidthStyle = ui.BoxWidthStyle.tight,
  this.textInputAction,
  this.focusNode,
  this.autofocus = false,
  this.enableKeyboardControls = true,
  this.enabled = true,
  this.readOnly = false,
  this.inputFormatters,
  this.maxPopupHeight = kDefaultMaxPopupHeight,
  this.onNoResultsFound,
  this.onError,
  this.tileHeight = kDefaultItemHeight,
  this.direction = AutoSuggestBoxDirection.below,
  this.keyboardType = TextInputType.text,
  this.maxLength,
  this.offset,
  this.onEditingComplete,
  this.enableCache = true,
  this.cacheMaxSize = 100,
  this.cacheDuration = const Duration(minutes: 30),
  this.debounceDelay = const Duration(milliseconds: 300),
  this.minSearchLength = 2,
}) : autovalidateMode = AutovalidateMode.disabled,
     validator = null,
     items = ValueNotifier(items.toSet()),
     cubit = null,
     cubitItemBuilder = null,
     labelBuilder = null,
     onCubitSelected = null,
     cubitFilters = null,
     showCubitStats = false,
     cubitLoadingBuilder = null,
     cubitErrorBuilder = null,
     cubitEmptyBuilder = null;