insertRows method

  1. @override
void insertRows(
  1. int rowIdx,
  2. List<PlutoRow> rows, {
  3. bool notify = true,
})
inherited

Implementation

@override
void insertRows(
  int rowIdx,
  List<PlutoRow> rows, {
  bool notify = true,
}) {
  _insertRows(rowIdx, rows);

  /// Update currentRowIdx
  if (currentCell != null) {
    updateCurrentCellPosition(notify: false);

    // todo : whether to apply scrolling.
  }

  /// Update currentSelectingPosition
  if (currentSelectingPosition != null &&
      rowIdx <= currentSelectingPosition!.rowIdx!) {
    setCurrentSelectingPosition(
      cellPosition: PlutoGridCellPosition(
        columnIdx: currentSelectingPosition!.columnIdx,
        rowIdx: rows.length + currentSelectingPosition!.rowIdx!,
      ),
      notify: false,
    );
  }

  notifyListeners(notify, insertRows.hashCode);
}