From 46bfa768fc450cad475337ce1ed69c7955cd1a0f Mon Sep 17 00:00:00 2001 From: dreautall <109872040+dreautall@users.noreply.github.com> Date: Sat, 26 Oct 2024 16:31:22 +0000 Subject: [PATCH] refresh Main Page Charts when transactions are updated fixes #456 --- lib/pages/home/main.dart | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib/pages/home/main.dart b/lib/pages/home/main.dart index 24af8a1a..2b3a2652 100644 --- a/lib/pages/home/main.dart +++ b/lib/pages/home/main.dart @@ -54,8 +54,17 @@ class _HomeMainState extends State final List catChartData = []; final Map budgetInfos = {}; + @override + void initState() { + super.initState(); + + context.read().transStock!.addListener(_refreshStats); + } + @override void dispose() { + context.read().transStock!.removeListener(_refreshStats); + super.dispose(); }