LifeMate — Personal, Family & Learning Companion
docs/offline-data-rescue-options
chore/phase1-repository-cleanup
deploy/stable-web-apk
deployment-static
design/mobile-accessibility-v2
design/mobile-navigation-review
docs/child-education-access-decision
docs/offline-data-rescue-options
docs/owner-guide-and-delivery-plan
docs/phase1-policy-options
docs/public-review-live-2026-10-15
feat/aparat-learning-library
feat/child-device-safety
feat/child-identity-schema
feat/flutter-mobile-navigation
feat/learning-content-operations
feat/local-signing-preflight
feat/online-family-stage0
feat/personal-encrypted-recovery
feat/private-planner-series-api
feat/public-review-page
feat/standalone-weekly-planner
feat/weekly-planner-android
final-feature-1/iran-family-school
fix/auth-abuse-expiry-safety
fix/auth-expiry-after-lock
fix/backend-request-safety
fix/lifeguide-bootstrap-naming-ci
fix/lifeguide-pages-qa-base-preflight
fix/lifeguide-qa-pages-env-deployment
fix/local-task-persistence
fix/managed-child-session-boundary
fix/personal-jalali-dates
fix/personal-notification-controls
fix/personal-upgrade-delivery-guard
fix/sms-approval-gates
fix/study-duration-display
infra/cloudflare-neon-migration
infra/lifeguide-cloudflare-qa
infra/lifeguide-github-pages-qa
infra/lifeguide-supabase-qa
main
phase-1/foundation-completion
phase-2/product-foundation-identity
phase-3/planner-school-family-core
phase-4/ai-learning-wellbeing
phase-5/hardening-observability-release
test/android-reminder-acceptance
test/personal-notification-settings
test/personal-recovery-acceptance
test/role-entry-apk
| 1 | /// Domain for the explicitly device-only edition. These records are not API |
| 2 | /// identities, cached server records, or acknowledgements of online writes. |
| 3 | enum StandaloneProfileCategory { girlMinor, boyMinor, adult } |
| 4 | |
| 5 | enum StandalonePlanKind { task, event, routine } |
| 6 | |
| 7 | enum StandaloneRecurrence { once, daily, everyTwoDays, weekly } |
| 8 | |
| 9 | class StandaloneProfile { |
| 10 | const StandaloneProfile( |
| 11 | {required this.id, |
| 12 | required this.displayName, |
| 13 | required this.category, |
| 14 | required this.companionName, |
| 15 | required this.themeKey}); |
| 16 | final String id; |
| 17 | final String displayName; |
| 18 | final StandaloneProfileCategory category; |
| 19 | final String companionName; |
| 20 | final String themeKey; |
| 21 | static const themeKeys = ['violet', 'blue', 'mint', 'coral']; |
| 22 | } |
| 23 | |
| 24 | /// Calendar operations use UTC only for day arithmetic. Occurrence clock times |
| 25 | /// remain local wall-clock times, including when the local UTC offset changes. |
| 26 | abstract final class StandaloneDate { |
| 27 | static DateTime only(DateTime value) => |
| 28 | DateTime(value.year, value.month, value.day); |
| 29 | static String key(DateTime value) => |
| 30 | '${value.year.toString().padLeft(4, '0')}-${value.month.toString().padLeft(2, '0')}-${value.day.toString().padLeft(2, '0')}'; |
| 31 | static DateTime parse(String value) { |
| 32 | final parsed = DateTime.parse(value); |
| 33 | return only(parsed); |
| 34 | } |
| 35 | |
| 36 | static int daysBetween(DateTime from, DateTime to) => |
| 37 | DateTime.utc(to.year, to.month, to.day) |
| 38 | .difference(DateTime.utc(from.year, from.month, from.day)) |
| 39 | .inDays; |
| 40 | static DateTime addDays(DateTime value, int count) => |
| 41 | DateTime(value.year, value.month, value.day + count); |
| 42 | } |
| 43 | |
| 44 | class StandaloneWeeklySlot { |
| 45 | const StandaloneWeeklySlot( |
| 46 | {required this.weekday, |
| 47 | required this.startMinute, |
| 48 | required this.endMinute}); |
| 49 | final int weekday; |
| 50 | final int startMinute; |
| 51 | final int endMinute; |
| 52 | } |
| 53 | |
| 54 | class StandalonePlanDraft { |
| 55 | const StandalonePlanDraft( |
| 56 | {required this.title, |
| 57 | required this.kind, |
| 58 | required this.recurrence, |
| 59 | required this.startDate, |
| 60 | required this.startMinute, |
| 61 | required this.endMinute, |
| 62 | this.untilDate, |
| 63 | this.weeklySlots = const [], |
| 64 | this.reminderMinutes}); |
| 65 | final String title; |
| 66 | final StandalonePlanKind kind; |
| 67 | final StandaloneRecurrence recurrence; |
| 68 | final DateTime startDate; |
| 69 | final DateTime? untilDate; |
| 70 | final int startMinute; |
| 71 | final int endMinute; |
| 72 | final List<StandaloneWeeklySlot> weeklySlots; |
| 73 | final int? reminderMinutes; |
| 74 | } |
| 75 | |
| 76 | class StandalonePlan { |
| 77 | StandalonePlan( |
| 78 | {required this.id, |
| 79 | required this.profileId, |
| 80 | required this.title, |
| 81 | required this.kind, |
| 82 | required this.recurrence, |
| 83 | required this.startDate, |
| 84 | required this.startMinute, |
| 85 | required this.endMinute, |
| 86 | required this.archived, |
| 87 | this.untilDate, |
| 88 | List<StandaloneWeeklySlot> weeklySlots = const [], |
| 89 | this.reminderMinutes}) |
| 90 | : weeklySlots = List.unmodifiable(weeklySlots); |
| 91 | final String id; |
| 92 | final String profileId; |
| 93 | final String title; |
| 94 | final StandalonePlanKind kind; |
| 95 | final StandaloneRecurrence recurrence; |
| 96 | final DateTime startDate; |
| 97 | final DateTime? untilDate; |
| 98 | final int startMinute; |
| 99 | final int endMinute; |
| 100 | final List<StandaloneWeeklySlot> weeklySlots; |
| 101 | final int? reminderMinutes; |
| 102 | final bool archived; |
| 103 | } |
| 104 | |
| 105 | class StandaloneOccurrence { |
| 106 | const StandaloneOccurrence( |
| 107 | {required this.id, |
| 108 | required this.planId, |
| 109 | required this.date, |
| 110 | required this.title, |
| 111 | required this.kind, |
| 112 | required this.startMinute, |
| 113 | required this.endMinute, |
| 114 | required this.completed, |
| 115 | required this.archived, |
| 116 | this.reminderMinutes}); |
| 117 | final String id; |
| 118 | final String planId; |
| 119 | final DateTime date; |
| 120 | final String title; |
| 121 | final StandalonePlanKind kind; |
| 122 | final int startMinute; |
| 123 | final int endMinute; |
| 124 | final bool completed; |
| 125 | final bool archived; |
| 126 | final int? reminderMinutes; |
| 127 | DateTime get startsAt => DateTime( |
| 128 | date.year, date.month, date.day, startMinute ~/ 60, startMinute % 60); |
| 129 | DateTime get endsAt => DateTime( |
| 130 | date.year, date.month, date.day, endMinute ~/ 60, endMinute % 60); |
| 131 | DateTime? get remindAt => reminderMinutes == null |
| 132 | ? null |
| 133 | : startsAt.subtract(Duration(minutes: reminderMinutes!)); |
| 134 | } |