update method

void update({
  1. required int indexInNew,
  2. required Row<E> previousRow,
})

Use .replace from previousRow

Implementation

void update({required int indexInNew, required Row<E> previousRow}) {
  final slotIndex = indexInNew + 1;
  slots[slotIndex] = previousRow.slots[slotIndex - 1];
}