buildSegmentsFromBudgetItems function

List<RallyPieChartSegment> buildSegmentsFromBudgetItems(
  1. List<BudgetData> items
)

Implementation

List<RallyPieChartSegment> buildSegmentsFromBudgetItems(
    List<BudgetData> items) {
  return List<RallyPieChartSegment>.generate(
    items.length,
    (i) {
      return RallyPieChartSegment(
        color: RallyColors.budgetColor(i),
        value: items[i].primaryAmount! - items[i].amountUsed!,
      );
    },
  );
}