@davoodmehraban89 / LifeMate / commits / 70cd274
Fork 0

LifeMate — Personal, Family & Learning Companion

feat: surface due reminder banners on Today

davoodmehraban89 committed Oct 5, 2026 at 15:22 UTC 70cd274e8cb8b9fdf59bcc6bbd6889dbe4e09948
1 file changed +12 -2
apps/lifemate/lib/phase3_ui.dart
+12 -2
@@ -106,8 +106,9 @@ class _TodayPageState extends State<TodayPage> {
106 final to = from.add(const Duration(days: 1));
107 try {
108 final items = await widget.api.getToday(from: from, to: to);
109 + final reminders = await widget.api.claimDueReminders();
110 await OfflineStore.instance.cacheToday(items);
110 - return LoadResult(items, false);
111 + return LoadResult(items, false, reminders: reminders);
112 } catch (_) {
113 return LoadResult(await OfflineStore.instance.readToday(), true);
114 }
@@ -155,6 +156,14 @@ class _TodayPageState extends State<TodayPage> {
156 leading: Icon(Icons.cloud_off_outlined),
157 title: Text('نمایش نسخه آفلاین'),
158 )),
159 + if (result.reminders.isNotEmpty)
160 + ...result.reminders.map((reminder) => Card(
161 + child: ListTile(
162 + leading: const Icon(Icons.notifications_active_outlined),
163 + title: Text('یادآوری · ' + (reminder['title']?.toString() ?? 'برنامه')),
164 + subtitle: const Text('زمان این مورد رسیده یا نزدیک است.'),
165 + ),
166 + )),
167 Card(
168 child: Padding(
169 padding: const EdgeInsets.all(18),
@@ -753,9 +762,10 @@ class EmptyCard extends StatelessWidget {
762 }
763
764 class LoadResult {
756 - const LoadResult(this.items, this.offline);
765 + const LoadResult(this.items, this.offline, {this.reminders = const []});
766 final List<Map<String, dynamic>> items;
767 final bool offline;
768 + final List<Map<String, dynamic>> reminders;
769 }
770
771 class SchoolLoad {