cellsTotalMap property

Map<TicketType, Map<DateRange, double>> get cellsTotalMap

Implementation

Map<TicketType, Map<DateRange, double>> get cellsTotalMap {
  final temp = <CellTotal>[];
  for (final report in this) {
    for (final ticketType in TicketType.financialTypes) {
      temp.add(
        CellTotal(
          DateRange(report.start, report.end),
          ticketType,
          report.financialFlows.sumTotalForType(ticketType),
        ),
      );
    }
  }
  final rows = <TicketType, Map<DateRange, double>>{};
  for (final fin in TicketType.financialTypes) {
    rows[fin] = {};
  }
  for (final row in rows.entries) {
    final cells = <DateRange, double>{};
    for (final e in temp.where((element) => element.ticketType == row.key)) {
      cells[e.dateRange] = e.total;
    }
    row.value.addAll(cells);
  }

  return rows;
}