rowBlueprint function

dynamic rowBlueprint(
  1. int rowCount,
  2. dynamic columns,
  3. dynamic rows
)

Generates empty rows from rowCount values provided

Implementation

rowBlueprint(int rowCount, columns, rows) {
  List sampleRow = [];
  for (var i = 0; i < rowCount; i++) {
    var item = {};
    columns.forEach((element) {
      item[element['key']] = '';
    });
    sampleRow.add(item);
  }
  rows = [...sampleRow];
  return rows;
}