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

@@ -16,7 +16,7 @@ class _TodoListState extends State<TodoList> {
@override
void initState() {
super.initState();
DbHelper.watchTodos().listen((event) {
DbHelper.todosChangedStream.listen((event) {
setState(() {
_todos = DbHelper.fetchTodos();
});
@@ -35,7 +35,16 @@ class _TodoListState extends State<TodoList> {
Widget _listBuilder(BuildContext context, int index) {
final todo = _todos.elementAt(index);
return ListTile(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
tileColor: Theme.of(context).colorScheme.primaryContainer,
title: Text(todo.title),
trailing: IconButton(
onPressed: () {},
icon: Icon(
Icons.check_box,
color: Theme.of(context).colorScheme.primary,
),
),
);
}
}