getSection method

Section? getSection(
  1. K sectionKey
)

Implementation

Section? getSection(K sectionKey) {
  _checkNotDisposed();
  final node = _tree.getNodeData(SectionKey<K>(sectionKey));
  if (node == null) {
    return null;
  }
  final data = node.data;
  assert(
    data is SectionPayload<Section, Item>,
    "Node at SectionKey($sectionKey) is not a SectionPayload — tree invariant violated",
  );
  return (data as SectionPayload<Section, Item>).value;
}