itemsOf method

List<Item> itemsOf(
  1. K sectionKey
)

Item payloads under sectionKey in render order, EXCLUDING pending-deletion. Returns [] for unknown sections.

Implementation

List<Item> itemsOf(K sectionKey) {
  _checkNotDisposed();
  final children = _tree.getLiveChildren(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;
}