Add, update, and delete are all working for each item type!!
This commit is contained in:
parent
8d7591b766
commit
84f1ec2f70
@ -34,6 +34,7 @@ class _HomePageState extends State<HomePage> {
|
||||
case 0:
|
||||
page = TrackedItemPage(
|
||||
assetsToLoad: DatabaseHelper.instance.getExpenses(),
|
||||
notifyParent: refresh,
|
||||
);
|
||||
dialog = TrackedItemInputDialog(
|
||||
notifyParent: refresh,
|
||||
@ -43,6 +44,7 @@ class _HomePageState extends State<HomePage> {
|
||||
case 1:
|
||||
page = TrackedItemPage(
|
||||
assetsToLoad: DatabaseHelper.instance.getIncomes(),
|
||||
notifyParent: refresh,
|
||||
);
|
||||
dialog = TrackedItemInputDialog(
|
||||
notifyParent: refresh,
|
||||
@ -52,6 +54,7 @@ class _HomePageState extends State<HomePage> {
|
||||
case 2:
|
||||
page = TrackedItemPage(
|
||||
assetsToLoad: DatabaseHelper.instance.getAssets(),
|
||||
notifyParent: refresh,
|
||||
);
|
||||
dialog = TrackedItemInputDialog(
|
||||
notifyParent: refresh,
|
||||
|
@ -12,10 +12,12 @@ import '/db.dart';
|
||||
|
||||
class TrackedItemPage extends StatefulWidget {
|
||||
final Future<List<TrackedItem>> assetsToLoad;
|
||||
final Function() notifyParent;
|
||||
|
||||
const TrackedItemPage({
|
||||
super.key,
|
||||
required this.assetsToLoad,
|
||||
required this.notifyParent,
|
||||
});
|
||||
|
||||
@override
|
||||
@ -23,10 +25,6 @@ class TrackedItemPage extends StatefulWidget {
|
||||
}
|
||||
|
||||
class _TrackedItemPageState extends State<TrackedItemPage> {
|
||||
refresh() {
|
||||
setState(() {});
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final theme = Theme.of(context);
|
||||
@ -171,7 +169,7 @@ class _TrackedItemPageState extends State<TrackedItemPage> {
|
||||
context: context,
|
||||
builder: (_) => AlertDialog(
|
||||
content: TrackedItemInputDialog(
|
||||
notifyParent: refresh,
|
||||
notifyParent: widget.notifyParent,
|
||||
entry: curr,
|
||||
amountText: curr.getAmountText(),
|
||||
type: curr.type!,
|
||||
|
Loading…
x
Reference in New Issue
Block a user