Changed styling, bit of refactoring

This commit is contained in:
SomnusVeritas
2023-11-08 12:31:42 +01:00
parent 1073dbbe41
commit 91ce231b04
5 changed files with 38 additions and 12 deletions

View File

@@ -10,12 +10,18 @@ class DashboardPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(),
floatingActionButton: FloatingActionButton(
onPressed: () =>
Navigator.of(context).pushNamed(CreateTodoPage.routeName),
child: const Icon(Icons.add),
),
body: const TodoList(),
body: Center(
child: SizedBox(
width: MediaQuery.of(context).size.width * 0.9,
child: const TodoList(),
),
),
);
}
}

View File

@@ -56,7 +56,7 @@ class _CreateTodoPageState extends State<CreateTodoPage> {
}
void _onSubmitted() {
DbHelper.addTodo(Todo(title: _title, description: _description));
DbHelper.addOrUpdateTodo(Todo(title: _title, description: _description));
Navigator.of(context).pop();
}
}