resizeForCapacity method

void resizeForCapacity(
  1. int nidCapacity
)

Grows the nid-indexed sticky array to match the controller's current nid capacity. Called from the render object's layout-array growth path so all per-nid arrays stay in lockstep.

Implementation

void resizeForCapacity(int nidCapacity) {
  if (nidCapacity <= _stickyByNid.length) return;
  final newSticky = List<StickyHeaderInfo<TKey>?>.filled(nidCapacity, null);
  for (int i = 0; i < _stickyByNid.length; i++) {
    newSticky[i] = _stickyByNid[i];
  }
  _stickyByNid = newSticky;
}