added more blocs

This commit is contained in:
2024-02-07 18:54:48 +01:00
parent 3610c466d2
commit c5ede79dc4
32 changed files with 668 additions and 429 deletions

View File

@@ -4,7 +4,7 @@ import 'package:equatable/equatable.dart';
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:tunas/domains/account/models/transaction_line.dart';
import 'package:tunas/domains/transaction/models/transaction_line.dart';
import 'package:tunas/domains/charts/models/chart_item.dart';
import 'package:tunas/repositories/account/account_repository.dart';
import 'package:tunas/repositories/account/models/transaction.dart';
@@ -149,7 +149,11 @@ class ChartBloc extends Bloc<ChartEvent, ChartState> {
}
if (categoriesColors[transaction.category] == null) {
categoriesColors[transaction.category] = colors[colorIndex];
if (colorIndex >= colors.length) {
categoriesColors[transaction.category] = const Color.fromARGB(255, 234, 0, 255);
} else {
categoriesColors[transaction.category] = colors[colorIndex];
}
colorIndex++;
}