subtotal method

Future<SubtotalResult> subtotal(
  1. AggregateType aggregate, {
  2. required int groupOnCol,
  3. required int aggregateCol,
  4. String caption = '',
  5. int backColor = 0xFFE0E0E0,
  6. int foreColor = 0xFF000000,
  7. bool addOutline = true,
  8. Font? font,
})

Insert subtotal rows grouping on groupOnCol and aggregating aggregateCol with the specified aggregate function.

Implementation

Future<SubtotalResult> subtotal(
  AggregateType aggregate, {
  required int groupOnCol,
  required int aggregateCol,
  String caption = '',
  int backColor = 0xFFE0E0E0,
  int foreColor = 0xFF000000,
  bool addOutline = true,
  Font? font,
}) async {
  final req = SubtotalRequest()
    ..gridId = _gridId
    ..aggregate = aggregate
    ..groupOnCol = groupOnCol
    ..aggregateCol = aggregateCol
    ..caption = caption
    ..background = backColor
    ..foreground = foreColor
    ..addOutline = addOutline;
  if (font != null) {
    req.font = font;
  }
  final result = await VolvoxGridService.Subtotal(req);
  notifyListeners();
  return result;
}