SelectionSingleListWidget constructor
SelectionSingleListWidget({
- Key? key,
- required List<
SelectionEntity> items, - required int flex,
- int focusedIndex = -1,
- double maxHeight = 0,
- Color? backgroundColor,
- Color? selectedBackgroundColor,
- SingleListItemSelect? singleListItemSelect,
- required SelectionConfig themeData,
Implementation
SelectionSingleListWidget({
Key? key,
required this.items,
required this.flex,
this.focusedIndex = -1,
this.maxHeight = 0,
this.backgroundColor,
this.selectedBackgroundColor,
this.singleListItemSelect,
required this.themeData,
}) : super(key: key) {
items = items
.where((_) =>
_.filterType != SelectionFilterType.range &&
_.filterType != SelectionFilterType.date &&
_.filterType != SelectionFilterType.dateRange &&
_.filterType != SelectionFilterType.dateRangeCalendar)
.toList();
/// 当前 Items 所在的层级
currentListIndex =
SelectionUtil.getCurrentListIndex(items.isNotEmpty ? items[0] : null);
_selectedItems = items.where((f) => f.isSelected).toList();
}