SmartSearchMultiDropdown<T, K>.withProvider constructor

const SmartSearchMultiDropdown<T, K>.withProvider({
  1. Key? key,
  2. required PaginationRequest request,
  3. required PaginationProvider<T> provider,
  4. required PaginationRequest searchRequestBuilder(
    1. String query
    ),
  5. required Widget itemBuilder(
    1. BuildContext context,
    2. T item
    ),
  6. void onSelected(
    1. List<T> items,
    2. List<K> keys
    )?,
  7. SearchDisplayMode displayMode = SearchDisplayMode.overlay,
  8. SmartSearchConfig searchConfig = const SmartSearchConfig(),
  9. SmartSearchOverlayConfig overlayConfig = const SmartSearchOverlayConfig(),
  10. SmartSearchBottomSheetConfig bottomSheetConfig = const SmartSearchBottomSheetConfig(),
  11. InputDecoration? decoration,
  12. TextStyle? style,
  13. Widget? prefixIcon,
  14. Widget? suffixIcon,
  15. bool showClearButton = true,
  16. BorderRadius? borderRadius,
  17. WidgetBuilder? loadingBuilder,
  18. WidgetBuilder? emptyBuilder,
  19. Widget errorBuilder(
    1. BuildContext context,
    2. Exception error
    )?,
  20. IndexedWidgetBuilder? separatorBuilder,
  21. WidgetBuilder? headerBuilder,
  22. WidgetBuilder? footerBuilder,
  23. BoxDecoration? overlayDecoration,
  24. bool showSelected = true,
  25. Widget selectedItemBuilder(
    1. BuildContext context,
    2. T item,
    3. VoidCallback onRemove
    )?,
  26. Widget selectedKeyBuilder(
    1. BuildContext context,
    2. K key,
    3. VoidCallback onRemove
    )?,
  27. List<T>? initialSelectedValues,
  28. List<K>? selectedKeys,
  29. K keyExtractor(
    1. T item
    )?,
  30. String selectedKeyLabelBuilder(
    1. K key
    )?,
  31. int? maxSelections,
  32. String? validator(
    1. String?
    )?,
  33. TextInputAction textInputAction = TextInputAction.search,
  34. List<TextInputFormatter>? inputFormatters,
  35. AutovalidateMode? autovalidateMode,
  36. ValueChanged<String>? onChanged,
  37. int? maxLength,
  38. TextCapitalization textCapitalization = TextCapitalization.none,
  39. TextInputType keyboardType = TextInputType.text,
  40. bool selectedItemsWrap = true,
  41. double selectedItemsSpacing = 8.0,
  42. double selectedItemsRunSpacing = 8.0,
  43. EdgeInsets selectedItemsPadding = const EdgeInsets.only(top: 12),
  44. String? hintText,
  45. VoidCallback? onMaxSelectionsReached,
  46. ListBuilder<T>? listBuilder,
  47. OnInsertionCallback<T>? onInsertionCallback,
  48. int maxPagesInMemory = 5,
  49. Logger? logger,
  50. RetryConfig? retryConfig,
  51. Duration? dataAge,
  52. SortOrderCollection<T>? orders,
})

Creates a multi-selection search dropdown with an internal cubit.

Implementation

const SmartSearchMultiDropdown.withProvider({
  super.key,
  required PaginationRequest request,
  required PaginationProvider<T> provider,
  required this.searchRequestBuilder,
  required this.itemBuilder,
  this.onSelected,
  this.displayMode = SearchDisplayMode.overlay,
  this.searchConfig = const SmartSearchConfig(),
  this.overlayConfig = const SmartSearchOverlayConfig(),
  this.bottomSheetConfig = const SmartSearchBottomSheetConfig(),
  this.decoration,
  this.style,
  this.prefixIcon,
  this.suffixIcon,
  this.showClearButton = true,
  this.borderRadius,
  this.loadingBuilder,
  this.emptyBuilder,
  this.errorBuilder,
  this.separatorBuilder,
  this.headerBuilder,
  this.footerBuilder,
  this.overlayDecoration,
  this.showSelected = true,
  this.selectedItemBuilder,
  this.selectedKeyBuilder,
  this.initialSelectedValues,
  this.selectedKeys,
  this.keyExtractor,
  this.selectedKeyLabelBuilder,
  this.maxSelections,
  this.validator,
  this.textInputAction = TextInputAction.search,
  this.inputFormatters,
  this.autovalidateMode,
  this.onChanged,
  this.maxLength,
  this.textCapitalization = TextCapitalization.none,
  this.keyboardType = TextInputType.text,
  this.selectedItemsWrap = true,
  this.selectedItemsSpacing = 8.0,
  this.selectedItemsRunSpacing = 8.0,
  this.selectedItemsPadding = const EdgeInsets.only(top: 12),
  this.hintText,
  this.onMaxSelectionsReached,
  ListBuilder<T>? listBuilder,
  OnInsertionCallback<T>? onInsertionCallback,
  int maxPagesInMemory = 5,
  Logger? logger,
  RetryConfig? retryConfig,
  Duration? dataAge,
  SortOrderCollection<T>? orders,
})  : _cubit = null,
      _request = request,
      _provider = provider,
      _listBuilder = listBuilder,
      _onInsertionCallback = onInsertionCallback,
      _maxPagesInMemory = maxPagesInMemory,
      _logger = logger,
      _retryConfig = retryConfig,
      _dataAge = dataAge,
      _orders = orders;