Skip to content

Commit

Permalink
Make modal take up full screen
Browse files Browse the repository at this point in the history
  • Loading branch information
chiraag918 committed May 23, 2023
1 parent 4c21d1e commit db1c928
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/expenses.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,19 @@ class Expenses extends StatefulWidget {
}

class _ExpensesState extends State<Expenses> {
List<Expense> _registeredExpenses = [];
final List<Expense> _registeredExpenses = [];

void addExpenses(expense) {
setState(() {
_registeredExpenses.add(expense);
_registeredExpenses = [..._registeredExpenses];
});
}

void _openAddExpenseOverlay() {
showModalBottomSheet(
isDismissible: true,
// To make the bottom sheet, take up the full screen
isScrollControlled: true,
context: context,
builder: (ctx) => NewExpense(addExpenses),
);
Expand Down
2 changes: 1 addition & 1 deletion lib/widgets/new_expense.dart
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class _NewExpenseState extends State<NewExpense> {
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.all(16),
padding: const EdgeInsets.fromLTRB(16, 48, 16, 16),
child: Column(
children: [
TextField(
Expand Down

0 comments on commit db1c928

Please sign in to comment.