insertRowAt method

void insertRowAt(
  1. int index, [
  2. T? row
])

Implementation

void insertRowAt(int index, [T? row]) {
  final v = row ?? newRow?.call();
  if (v == null) return;
  final i = index.clamp(0, _rows.length);
  _apply(List<T>.from(_rows)..insert(i, v));
  _sel = CellRef(i, 0);
  notifyListeners();
}