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 { - 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 { ); // Calculations for the projections. - Widget projections; if (_assetTotal < 0 || _incomeMonthly < 0 || @@ -59,7 +68,11 @@ class _ProjectionPageState extends State { _expenseYearly < 0) { _showProjections = false; - projections = Center(child: SizedBox(child: CircularProgressIndicator())); + projections = Center( + child: SizedBox( + child: CircularProgressIndicator(), + ), + ); Future.delayed(Duration(seconds: 1), () { setState(() {