Always show the add button for budgets

This commit is contained in:
PapaTutuWawa 2025-05-04 23:36:17 +02:00
parent 2cc9a2bef5
commit 6e3329b9f4

View File

@ -12,27 +12,15 @@ class BudgetListPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BlocBuilder<CoreCubit, CoreState>( return Stack(
children: [
BlocBuilder<CoreCubit, CoreState>(
builder: (context, state) { builder: (context, state) {
if (state.budgets.isEmpty) { if (state.budgets.isEmpty) {
return Column( return Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Text("No budgets"), Text("No budgets"),
OutlinedButton(
onPressed: () {
showDialogOrModal(
context: context,
builder:
(_) => AddBudgetPopup(
onDone: () {
Navigator.of(context).pop();
},
),
);
},
child: Text("Add"),
),
], ],
); );
} }
@ -51,7 +39,8 @@ class BudgetListPage extends StatelessWidget {
onPressed: () { onPressed: () {
showDialogOrModal( showDialogOrModal(
context: context, context: context,
builder: (_) => EditBudgetPopup( builder:
(_) => EditBudgetPopup(
budget: state.activeBudget!, budget: state.activeBudget!,
onDone: () { onDone: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
@ -79,6 +68,27 @@ class BudgetListPage extends StatelessWidget {
), ),
); );
}, },
),
Positioned(
right: 16,
bottom: 16,
child: FloatingActionButton(
child: Icon(Icons.add),
onPressed: () {
showDialogOrModal(
context: context,
builder:
(_) => AddBudgetPopup(
onDone: () {
Navigator.of(context).pop();
},
),
);
},
),
),
],
); );
} }
} }