From aa3c2f93047d5a2665434b1b86010bc1c0e2262b Mon Sep 17 00:00:00 2001 From: Hyperling Date: Wed, 5 Feb 2025 03:20:29 -0700 Subject: [PATCH] Expense input form is now in a popup! Still needs to look and function properly though. --- lib/main.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index 4de3fa9..7a4536f 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -67,14 +67,20 @@ class _HomePageState extends State { throw UnimplementedError('No widget for page $pageSelected yet!'); } - Widget newValue() { - return AlertDialog(title: Text("Add New Value"), content: dialog); + Future addNewValue(BuildContext context) { + return showDialog( + context: context, + builder: (_) => + AlertDialog(title: Text("Add New Value"), content: dialog) + ); } Widget? floatingButton; if (dialog != null) { floatingButton = IconButton( - onPressed: newValue, + onPressed: () { + addNewValue(context); + }, icon: Icon(Icons.add), color: Theme.of(context).colorScheme.onSurface, ); @@ -140,7 +146,6 @@ class ExpensePage extends StatelessWidget { Widget build(BuildContext context) { return ListView( children: [ - ExpenseInputForm(), ListTile( title: Text("Fake Item 1"), subtitle: Text("30.00 / month"),