Improved stacked graph

This commit is contained in:
2024-02-11 22:49:57 +01:00
parent cbaf94d866
commit a51ca14041
5 changed files with 118 additions and 24 deletions

View File

@@ -27,7 +27,9 @@ final class ChartState extends Equatable {
final List<ChartItem> scopedSimplifiedCategoriesNegativeTotalsPercents;
final List<FlSpot> scopedMonthlyTotals;
final Map<int, Map<String, double>> scopedCategoriesMonthlyTotals;
final Map<int, MonthTotals> scopedCategoriesMonthlyTotals;
final Map<int, double> scopedMonthlyPostitiveTotals;
final Map<int, double> scopedMonthlyNegativeTotals;
final double scoppedProfit;
@@ -53,6 +55,8 @@ final class ChartState extends Equatable {
this.scopedMonthlyTotals = const [],
this.scopedCategoriesMonthlyTotals = const {},
this.scoppedProfit = 0,
this.scopedMonthlyPostitiveTotals = const {},
this.scopedMonthlyNegativeTotals = const {},
});
ChartState copyWith({
@@ -75,8 +79,10 @@ final class ChartState extends Equatable {
List<ChartItem>? scopedSimplifiedCategoriesNegativeTotals,
List<ChartItem>? scopedSimplifiedCategoriesNegativeTotalsPercents,
List<FlSpot>? scopedMonthlyTotals,
Map<int, Map<String, double>>? scopedCategoriesMonthlyTotals,
Map<int, MonthTotals>? scopedCategoriesMonthlyTotals,
double? scoppedProfit,
Map<int, double>? scopedMonthlyPostitiveTotals,
Map<int, double>? scopedMonthlyNegativeTotals,
}) {
return ChartState(
transactions: transactions ?? this.transactions,
@@ -100,6 +106,8 @@ final class ChartState extends Equatable {
scopedMonthlyTotals: scopedMonthlyTotals ?? this.scopedMonthlyTotals,
scopedCategoriesMonthlyTotals: scopedCategoriesMonthlyTotals ?? this.scopedCategoriesMonthlyTotals,
scoppedProfit: scoppedProfit ?? this.scoppedProfit,
scopedMonthlyPostitiveTotals: scopedMonthlyPostitiveTotals ?? this.scopedMonthlyPostitiveTotals,
scopedMonthlyNegativeTotals: scopedMonthlyNegativeTotals ?? this.scopedMonthlyNegativeTotals,
);
}
@@ -124,6 +132,8 @@ final class ChartState extends Equatable {
scopedMonthlyTotals,
scopedCategoriesMonthlyTotals,
scoppedProfit,
scopedMonthlyPostitiveTotals,
scopedMonthlyNegativeTotals,
];
}