insertColumnByKey method

Future<bool> insertColumnByKey(
  1. Object key,
  2. List values, {
  3. int fromRow = 2,
  4. bool eager = true,
})

Updates column by its name values with values.

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

values - values to insert (not null nor empty)

key - name of a column to insert values to The first row considered to be column names

fromRow - optional (defaults to 2), row index for the first inserted value of values, rows start at index 1

eager - optional (defaults to true), whether to add key if absent

Returns Future true in case of success.

Throws GSheetsException.

Implementation

Future<bool> insertColumnByKey(
  Object key,
  List<dynamic> values, {
  int fromRow = 2,
  bool eager = true,
}) async {
  final column = await columnIndexOf(key, add: eager);
  if (column < 1) return false;
  return insertColumn(column, values, fromRow: fromRow);
}