insertRows method

Future<bool> insertRows(
  1. int row,
  2. List<List> values, {
  3. int fromColumn = 1,
})

Updates rows with values.

Expands current sheet's size if inserting range is out of sheet's bounds.

values - values to insert (not null nor empty)

row - row index to insert values to, rows start at index 1

fromColumn - optional (defaults to 1), column index for the first inserted value of values, columns start at index 1 (column A)

Returns Future true in case of success.

Throws GSheetsException.

Implementation

Future<bool> insertRows(
  int row,
  List<List<dynamic>> values, {
  int fromColumn = 1,
}) async {
  checkIndex('row', row);
  checkIndex('fromColumn', fromColumn);
  checkValues(values);
  return _ws._updateAll(
    values: values,
    range: await _ws._allRowsRange(row, fromColumn, -1, values.length),
    majorDimension: dimenRows,
  );
}