# Scheduler
The scheduler module provides calendar-based visualization and management of health events, including medications, medical appointments, and mood tracking. It offers multiple time-scale views (day/month/year).

## Screens
- `DailyTrackerScreen`: Daily view combining medications, appointments, and mood tracking
- `CalendarScreen`: Monthly calendar view with visual indicators for all health events
- `YearScreen`: An annual overview showing all 365 days simultaneously with color-coded days indicating medical events or mood entries

## View Modes
- `Medical Mode`: Shows medication schedules and medical appointments
- `Mood Mode`: Displays mood tracking data with emotion-based color coding

## Providers
### Core Providers
```dart
// Tracks the currently selected date (used in DailyTrackerScreen)
final selectedDateProvider = StateProvider<DateTime>((ref) => DateTime.now());

// Controls animation direction for day changes
final slideDirectionProvider = StateProvider<bool>((ref) => true);

// Tracks the calendar view mode (medical or mood)
final calendarViewModeProvider = StateProvider<CalendarViewMode>((ref) => CalendarViewMode.medical);
```
### Derived Data Providers
```dart
// Gets bloodwork records for a specific date
final bloodworkForSelectedDateProvider = Provider.family<List<Bloodwork>, DateTime>((ref, date) { ... });

// Processes medication doses with indexes for uniqueness
final uniqueMedicationDosesProvider = Provider.family<List<(MedicationDose, int, Medication)>, DateTime>((ref, date) { ... });

// Checks if a specific medication dose is marked as taken
final isUniqueDoseTakenProvider = Provider.family<bool, (MedicationDose, int)>((ref, params) { ... });

// Checks if there's a mood entry for a specific date
final moodEntryExistsProvider = Provider.family<bool, DateTime>((ref, date) { ... });
```

## Integration
The scheduler module integrates data from:
- `MedicationTracker` for medication schedules
- `BloodworkTracker` for appointments
- `MoodTracker` for mood entries