feat:增加统计模块年份选择功能

This commit is contained in:
2025-11-14 15:49:33 +08:00
parent b4cda27e64
commit a582ebb3e4
5 changed files with 191 additions and 13 deletions

View File

@@ -19,6 +19,13 @@ class TodoService {
return box.values.toList();
}
List<Todo> getAllTodosByYear(int year) {
return box.values
.toList()
.where((todo) => todo.createTime.year == year)
.toList();
}
Future<bool> updateTodo(Todo todo) async {
try {
await todo.save();