Fix the layout when there are no items.
This commit is contained in:
		@@ -118,11 +118,9 @@ class _HomePageState extends State<HomePage> {
 | 
				
			|||||||
            });
 | 
					            });
 | 
				
			||||||
          },
 | 
					          },
 | 
				
			||||||
        ),
 | 
					        ),
 | 
				
			||||||
        body: Center(
 | 
					        body: Container(
 | 
				
			||||||
          child: Container(
 | 
					 | 
				
			||||||
          color: Theme.of(context).colorScheme.primaryContainer,
 | 
					          color: Theme.of(context).colorScheme.primaryContainer,
 | 
				
			||||||
            child: page,
 | 
					          child: Center(child: page),
 | 
				
			||||||
          ),
 | 
					 | 
				
			||||||
        ),
 | 
					        ),
 | 
				
			||||||
        floatingActionButton: floatingButton,
 | 
					        floatingActionButton: floatingButton,
 | 
				
			||||||
      );
 | 
					      );
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -12,7 +12,9 @@ class ExpensePage extends StatelessWidget {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  @override
 | 
					  @override
 | 
				
			||||||
  Widget build(BuildContext context) {
 | 
					  Widget build(BuildContext context) {
 | 
				
			||||||
    return ListView.builder(
 | 
					    return expenses.isEmpty
 | 
				
			||||||
 | 
					        ? Text("Add expenses to get started!")
 | 
				
			||||||
 | 
					        : ListView.builder(
 | 
				
			||||||
            itemCount: expenses.length,
 | 
					            itemCount: expenses.length,
 | 
				
			||||||
            itemBuilder: (_, index) {
 | 
					            itemBuilder: (_, index) {
 | 
				
			||||||
              final Expense curr = expenses[index];
 | 
					              final Expense curr = expenses[index];
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user