MultiItemDropper<T> constructor

const MultiItemDropper<T>({
  1. Key? key,
  2. required List<ItemDropperItem<T>> items,
  3. List<ItemDropperItem<T>>? selectedItems,
  4. required void onChanged(
    1. List<ItemDropperItem<T>>
    ),
  5. Widget popupItemBuilder(
    1. BuildContext,
    2. ItemDropperItem<T>,
    3. bool
    )?,
  6. required double width,
  7. bool enabled = true,
  8. String? hintText,
  9. int? maxSelected,
  10. ItemDropperItem<T>? onAddItem(
    1. String searchText
    )?,
  11. void onDeleteItem(
    1. ItemDropperItem<T> item
    )?,
  12. GlobalKey<State<StatefulWidget>>? inputKey,
  13. double maxDropdownHeight = MultiSelectConstants.kDefaultMaxDropdownHeight,
  14. bool showScrollbar = true,
  15. double scrollbarThickness = ItemDropperConstants.kDefaultScrollbarThickness,
  16. double? itemHeight,
  17. TextStyle? popupTextStyle,
  18. TextStyle? popupGroupHeaderStyle,
  19. TextStyle? fieldTextStyle,
  20. BoxDecoration? selectedChipDecoration,
  21. BoxDecoration? fieldDecoration,
  22. double? elevation,
  23. bool showDropdownPositionIcon = true,
  24. bool showDeleteAllIcon = true,
  25. ItemDropperLocalizations? localizations,
})

Implementation

const MultiItemDropper({
  super.key,
  required this.items,
  this.selectedItems,
  required this.onChanged,
  this.popupItemBuilder,
  required this.width,
  this.enabled = true,
  this.hintText,
  this.maxSelected,
  this.onAddItem,
  this.onDeleteItem,
  this.inputKey,
  this.maxDropdownHeight = MultiSelectConstants.kDefaultMaxDropdownHeight,
  this.showScrollbar = true,
  this.scrollbarThickness = ItemDropperConstants.kDefaultScrollbarThickness,
  this.itemHeight,
  this.popupTextStyle,
  this.popupGroupHeaderStyle,
  this.fieldTextStyle,
  this.selectedChipDecoration,
  this.fieldDecoration,
  this.elevation,
  this.showDropdownPositionIcon = true,
  this.showDeleteAllIcon = true,
  this.localizations,
}) : assert(
       maxSelected == null || maxSelected >= 2,
       'maxSelected must be null or >= 2',
     );