From fa852faadc2ff33f472c7f05a1655fa32b511e75 Mon Sep 17 00:00:00 2001
From: Hyperling <me@hyperling.com>
Date: Wed, 26 Mar 2025 13:17:08 -0700
Subject: [PATCH] Use the dispose() method to reset the global values. Works
 excellently!! :D

---
 lib/pages/report.dart | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/lib/pages/report.dart b/lib/pages/report.dart
index 60e86b6..e30bbeb 100644
--- a/lib/pages/report.dart
+++ b/lib/pages/report.dart
@@ -31,7 +31,17 @@ class ProjectionPage extends StatefulWidget {
 }
 
 class _ProjectionPageState extends State<ProjectionPage> {
-  bool? _showProjections = true;
+  bool _showProjections = true;
+
+  @override
+  void dispose() {
+    _assetTotal = -2;
+    _expenseMonthly = -2;
+    _expenseYearly = -2;
+    _incomeMonthly = -2;
+    _incomeYearly = -2;
+    super.dispose();
+  }
 
   @override
   Widget build(BuildContext context) {
@@ -50,7 +60,6 @@ class _ProjectionPageState extends State<ProjectionPage> {
     );
 
     // Calculations for the projections.
-
     Widget projections;
     if (_assetTotal < 0 ||
         _incomeMonthly < 0 ||
@@ -59,7 +68,11 @@ class _ProjectionPageState extends State<ProjectionPage> {
         _expenseYearly < 0) {
       _showProjections = false;
 
-      projections = Center(child: SizedBox(child: CircularProgressIndicator()));
+      projections = Center(
+        child: SizedBox(
+          child: CircularProgressIndicator(),
+        ),
+      );
 
       Future.delayed(Duration(seconds: 1), () {
         setState(() {