Date: March 31, 2026 Current Phase: Phase 7 (Flutter App Development) — In Progress Previous Log: Day 5 (Phase 7 ①~⑦ Complete)


✅ Phase 7 Overall Progress

Task Description Status
① Project structure setup Directory structure, theme, constants ✅ Done
② Supabase integration + Auth service Auth layer, Riverpod state ✅ Done
③ Routing setup go_router, redirect logic ✅ Done
④ Splash / Onboarding screen App entry flow, 3-page onboarding ✅ Done
⑤ Login / Register screen Email auth UI, form validation ✅ Done
⑥ Home screen Today's schedule, confirm/skip dose ✅ Done
⑦ Medication add screen Medication form, cycle/time settings ✅ Done
⑧ Medication list / edit screen List, edit, delete, toggle ✅ Done
⑨ Dose history calendar Monthly calendar, log list ✅ Done
⑩ Statistics screen Weekly/monthly adherence, bar chart ✅ Done
⑪ Notification settings screen Notifications on/off, advance time ✅ Done
⑫ Settings screen Profile, account, app info ✅ Done
⑬ FCM/APNs push notification integration Firebase, local notifications, token ✅ Done
⑭ Interactive notifications (Yes/No) Lock screen confirm/skip ✅ Done
⑮ Google / Apple social login 🔜 Next

1. ⑧ Medication List / Edit Screen

Files Created

lib/features/medications/domain/medication.dart            ← copyWith, MedicationUpdateRequest added
lib/features/medications/data/medication_repository.dart   ← GET, PATCH, DELETE added
lib/features/medications/providers/medication_provider.dart ← list, update, toggle, delete added
lib/features/medications/presentation/medication_list_screen.dart
lib/features/medications/presentation/medication_edit_screen.dart

Key Implementation

MedicationListScreen

Splits medications into active/inactive sections. Each card offers a toggle switch and a popup menu (edit/delete).

final active   = medications.where((m) => m.isActive).toList();
final inactive = medications.where((m) => !m.isActive).toList();

Optimistic Toggle

Updates the UI immediately before the API responds. Rolls back automatically on failure.

Future<void> toggle(String id) async {
  state = AsyncValue.data(current.map((m) {
    if (m.id == id) return m.copyWith(isActive: !m.isActive);
    return m;
  }).toList());
  try {
    await _repo.toggleMedication(id);
  } catch (_) {
    refresh(); // rollback
  }
}

MedicationEditScreen

Pre-populates controllers from the existing medication in initState to reuse the form layout.

Delete confirmation dialog

Two-step AlertDialog confirmation to prevent accidental deletion.

Troubleshooting