insertRow method

Future<bool> insertRow(
  1. int row, {
  2. int count = 1,
  3. bool inheritFromBefore = false,
})

Inserts new rows to Worksheet.

row - index of a row to insert, rows start at index 1

count - optional (defaults to 1), the number of rows to insert

inheritFromBefore - optional (defaults to false), if true, tells the API to give the new rows the same properties as the prior row, otherwise the new rows acquire the properties of those that follow them, cannot be true if inserting a row with index 1

Returns Future true in case of success.

Throws GSheetsException.

Implementation

Future<bool> insertRow(
  int row, {
  int count = 1,
  bool inheritFromBefore = false,
}) async {
  checkIndex('row', row);
  final isInserted = await _insertDimension(
    dimenRows,
    row,
    count,
    inheritFromBefore,
  );
  if (isInserted) {
    _rowCount = _rowCount + count;
  }
  return isInserted;
}