allItemsOf method

List<Item> allItemsOf(
  1. K sectionKey
)

All item payloads under sectionKey in render order, INCLUDING pending-deletion.

Implementation

List<Item> allItemsOf(K sectionKey) {
  _checkNotDisposed();
  final children = _tree.getChildren(SectionKey<K>(sectionKey));
  if (children.isEmpty) {
    return const [];
  }
  final out = <Item>[];
  for (final k in children) {
    if (!_assertIsItem(k)) {
      continue;
    }
    final node = _tree.getNodeData(k);
    if (node == null) {
      continue;
    }
    final data = node.data;
    if (data is ItemPayload<Section, Item>) {
      out.add(data.value);
    }
  }
  return out;
}