feat: Implement pending notifications screen and enhance notification handling

This commit is contained in:
2025-08-26 18:15:35 +02:00
parent 2aec59ec35
commit 53dfd92cec
6 changed files with 457 additions and 14 deletions

View File

@@ -431,11 +431,13 @@ class DatabaseHelper {
Future<List<Map<String, dynamic>>> getPendingNotifications() async {
Database db = await database;
return await db.query(
notificationTrackingTable,
where: 'status IN (?, ?)',
whereArgs: ['pending', 'retrying'],
);
return await db.rawQuery('''
SELECT nt.*, s.name as supplementName
FROM $notificationTrackingTable nt
LEFT JOIN $supplementsTable s ON nt.supplementId = s.id
WHERE nt.status IN (?, ?)
ORDER BY nt.scheduledTime ASC
''', ['pending', 'retrying']);
}
Future<void> markNotificationExpired(int notificationId) async {