setCellStyleRange method

Future<void> setCellStyleRange(
  1. int row1,
  2. int col1,
  3. int row2,
  4. int col2,
  5. CellStyle style,
)

Apply cell style to an explicit range.

Implementation

Future<void> setCellStyleRange(
  int row1,
  int col1,
  int row2,
  int col2,
  CellStyle style,
) async {
  final req = UpdateCellsRequest()..gridId = _gridId;
  for (var r = row1; r <= row2; r++) {
    for (var c = col1; c <= col2; c++) {
      req.cells.add(CellUpdate()
        ..row = r
        ..col = c
        ..style = style);
    }
  }
  await VolvoxGridService.UpdateCells(req);
  notifyListeners();
}