Enhance: Google Photos integration, refinement of Schedule/Todo lists and API fixes

This commit is contained in:
kihong.kim
2026-02-01 01:05:33 +09:00
parent c614c883d4
commit 5fa24d61c9
7 changed files with 56 additions and 40 deletions

View File

@@ -20,14 +20,23 @@ class TodoService {
Future<List<TodoItem>> fetchTodayTodos() async {
if (ApiConfig.useMockData) {
final today = DateTime.now();
return MockDataStore.todos.where((todo) => todo.dueDate != null).where((
todo,
) {
final date = todo.dueDate!;
return date.year == today.year &&
date.month == today.month &&
date.day == today.day;
final now = DateTime.now();
final today = DateTime(now.year, now.month, now.day);
final tomorrow = today.add(const Duration(days: 1));
return MockDataStore.todos.where((todo) {
if (todo.completed) {
// If completed, only show if it was due today
if (todo.dueDate == null) return false;
return todo.dueDate!.isAfter(today.subtract(const Duration(milliseconds: 1))) &&
todo.dueDate!.isBefore(tomorrow);
}
// If not completed:
// 1. No due date -> show
// 2. Due today or before -> show
if (todo.dueDate == null) return true;
return todo.dueDate!.isBefore(tomorrow);
}).toList();
}
final data = await _client.getList("${ApiConfig.todos}/today");