diff --git a/lib/util/graphs.dart b/lib/util/graphs.dart index 6ad292e..3abf042 100644 --- a/lib/util/graphs.dart +++ b/lib/util/graphs.dart @@ -428,11 +428,39 @@ class _CategoriesPieChartState extends State { (index) => Padding( padding: const EdgeInsets.all(8), child: Indicator( - size: touchedIndex == index ? 18 : 16, + size: (touchedIndex != -1 && + touchedIndex == + widget.categories + .where( + (element) => widget.entries + .where( + (w) => + w.category.id == + element + .id, // TODO: more elegant fix + ) + .isNotEmpty, + ) + .toList() + .indexOf(widget.categories[index])) + ? 18 + : 16, color: widget.categories[index].color, text: widget.categories[index].name, textStyle: TextStyle( - fontWeight: (touchedIndex == index) + fontWeight: (touchedIndex != -1 && + touchedIndex == + widget.categories + .where( + (element) => widget.entries + .where( + (w) => + w.category.id == element.id, + ) + .isNotEmpty, + ) + .toList() + .indexOf(widget.categories[index])) ? FontWeight.bold : FontWeight.normal, ),