Changed styling, bit of refactoring
This commit is contained in:
@@ -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(),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user