Fix the layout when there are no items.
This commit is contained in:
parent
ecbac615e9
commit
360a36f024
@ -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,
|
||||
);
|
||||
|
@ -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];
|
||||
|
Loading…
x
Reference in New Issue
Block a user