ListSelectionWidget constructor

const ListSelectionWidget({
  1. Key? key,
  2. required List<SelectionItem> listItems,
  3. List? multiSelectValues = const [],
  4. dynamic onMultiItemsSelected(
    1. List
    )?,
  5. bool? hideLines,
  6. EdgeInsetsGeometry? itemMargin,
  7. EdgeInsetsGeometry? itemPadding,
  8. TextStyle? titleStyle,
  9. Decoration? decoration,
  10. EdgeInsets? contentPadding,
  11. required String hintText,
  12. Widget? titleIcon,
  13. bool? scrollControl,
  14. double? maxHeight,
  15. EdgeInsets? titlePadding,
  16. TextStyle? itemTextStyle,
  17. dynamic selectedValue,
  18. dynamic onSingleItemSelected(
    1. dynamic
    )?,
  19. required bool isMultiSelection,
  20. Widget? selectedIcon,
  21. Color? collapsedIconColor,
  22. Color? expandedIconColor,
  23. Color? selectedIconColor,
  24. Color? backgroundSelectedIconColor,
  25. Color? unSelecctedIconColor,
  26. TextStyle? selectedItemTextStyle,
})

Implementation

const ListSelectionWidget({
  Key? key,
  required this.listItems,
  this.multiSelectValues = const [],
  this.onMultiItemsSelected,
  this.hideLines,
  this.itemMargin,
  this.itemPadding,
  this.titleStyle,
  this.decoration,
  this.contentPadding,
  required this.hintText,
  this.titleIcon,
  this.scrollControl,
  this.maxHeight,
  this.titlePadding,
  this.itemTextStyle,
  this.selectedValue,
  this.onSingleItemSelected,
  required this.isMultiSelection,
  this.selectedIcon,
  this.collapsedIconColor,
  this.expandedIconColor,
  this.selectedIconColor,
  this.backgroundSelectedIconColor,
  this.unSelecctedIconColor,
  this.selectedItemTextStyle,
})  : assert(
        (isMultiSelection && onMultiItemsSelected != null) ||
            (!isMultiSelection && onSingleItemSelected != null),
        'Invalid configuration: If isMultiSelection is true, you must provide onMultiItemsSelected. If isMultiSelection is false, you must provide onSingleItemSelected.',
      ),
      assert(
          scrollControl == true
              ? (maxHeight != null && maxHeight > 30)
              : true,
          'You must enter a max height greater than 30 if you want to scroll through the list'),
      super(key: key);