addRow method

void addRow(
  1. List<Object?> columnValues
)

Adds a new row to the end with the given columnValues.

The columnValues must have the same length as columnNames and have the same order.

Implementation

void addRow(List<Object?> columnValues) {
  if (columnValues.length != _columnCount) {
    throw ArgumentError(
      "The `columnValues` parameter must have the same length as `columnNames`. "
      "The lengths were: columnValues = ${columnValues.length}, columnNames = ${_columnNames.length}",
    );
  }

  int start = _rowCount * _columnCount;
  _rowCount += 1;
  _ensureCapacity(start + _columnCount);
  _data.setRange(start, start + _columnCount, columnValues);
}