SelectionSingleListWidget constructor

SelectionSingleListWidget({
  1. Key? key,
  2. required List<SelectionEntity> items,
  3. required int flex,
  4. int focusedIndex = -1,
  5. double maxHeight = 0,
  6. Color? backgroundColor,
  7. Color? selectedBackgroundColor,
  8. SingleListItemSelect? singleListItemSelect,
  9. 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();
}