ListSelectionWidget constructor
const
ListSelectionWidget({
- Key? key,
- required List<
SelectionItem> listItems, - List? multiSelectValues = const [],
- dynamic onMultiItemsSelected()?,
- bool? hideLines,
- EdgeInsetsGeometry? itemMargin,
- EdgeInsetsGeometry? itemPadding,
- TextStyle? titleStyle,
- Decoration? decoration,
- EdgeInsets? contentPadding,
- required String hintText,
- Widget? titleIcon,
- bool? scrollControl,
- double? maxHeight,
- EdgeInsets? titlePadding,
- TextStyle? itemTextStyle,
- dynamic selectedValue,
- dynamic onSingleItemSelected(
- dynamic
- required bool isMultiSelection,
- Widget? selectedIcon,
- Color? collapsedIconColor,
- Color? expandedIconColor,
- Color? selectedIconColor,
- Color? backgroundSelectedIconColor,
- Color? unSelecctedIconColor,
- 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);