Fix the layout when there are no items.

This commit is contained in:
Hyperling 2025-02-05 14:16:49 -07:00
parent ecbac615e9
commit 360a36f024
2 changed files with 28 additions and 28 deletions

View File

@ -118,11 +118,9 @@ class _HomePageState extends State<HomePage> {
});
},
),
body: Center(
child: Container(
body: Container(
color: Theme.of(context).colorScheme.primaryContainer,
child: page,
),
child: Center(child: page),
),
floatingActionButton: floatingButton,
);

View File

@ -12,7 +12,9 @@ class ExpensePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return ListView.builder(
return expenses.isEmpty
? Text("Add expenses to get started!")
: ListView.builder(
itemCount: expenses.length,
itemBuilder: (_, index) {
final Expense curr = expenses[index];