insertColumnByKey method
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);
}