Improved category with colors

This commit is contained in:
2024-02-09 01:22:04 +01:00
parent c5ede79dc4
commit 44f6d433d1
14 changed files with 303 additions and 170 deletions

View File

@@ -29,8 +29,6 @@ final class ChartState extends Equatable {
final List<FlSpot> scopedMonthlyTotals;
final Map<int, Map<String, double>> scopedCategoriesMonthlyTotals;
final Map<String, Color> categoriesColors;
const ChartState({
this.transactions = const [],
this.transactionsLines = const [],
@@ -52,7 +50,6 @@ final class ChartState extends Equatable {
this.scopedSimplifiedCategoriesNegativeTotalsPercents = const [],
this.scopedMonthlyTotals = const [],
this.scopedCategoriesMonthlyTotals = const {},
this.categoriesColors = const {},
});
ChartState copyWith({
@@ -76,7 +73,6 @@ final class ChartState extends Equatable {
List<ChartItem>? scopedSimplifiedCategoriesNegativeTotalsPercents,
List<FlSpot>? scopedMonthlyTotals,
Map<int, Map<String, double>>? scopedCategoriesMonthlyTotals,
Map<String, Color>? categoriesColors,
}) {
return ChartState(
transactions: transactions ?? this.transactions,
@@ -99,7 +95,6 @@ final class ChartState extends Equatable {
scopedSimplifiedCategoriesNegativeTotalsPercents: scopedSimplifiedCategoriesNegativeTotalsPercents ?? this.scopedSimplifiedCategoriesNegativeTotalsPercents,
scopedMonthlyTotals: scopedMonthlyTotals ?? this.scopedMonthlyTotals,
scopedCategoriesMonthlyTotals: scopedCategoriesMonthlyTotals ?? this.scopedCategoriesMonthlyTotals,
categoriesColors: categoriesColors ?? this.categoriesColors,
);
}
@@ -123,7 +118,6 @@ final class ChartState extends Equatable {
scopedSimplifiedCategoriesNegativeTotalsPercents,
scopedMonthlyTotals,
scopedCategoriesMonthlyTotals,
categoriesColors,
];
}