feat(calendar): implement ReminderOverlay and supporting components

- Add ReminderQueueManager for managing notification queue
- Add IOSNotificationPayloadBridge for iOS cold start handling
- Add ReminderOverlay UI component with snooze (5/15 min) and complete actions
- Update main.dart to integrate ReminderOverlay
- LocalNotificationService: remove permission fallback logic, add native grouping
This commit is contained in:
qzl
2026-03-20 18:47:50 +08:00
parent 6e35fff9a4
commit 4b29b300da
4 changed files with 347 additions and 4 deletions
@@ -0,0 +1,27 @@
import 'dart:convert';
import 'package:shared_preferences/shared_preferences.dart';
import '../../features/calendar/reminders/models/reminder_payload.dart';
class IOSNotificationPayloadBridge {
static const String _key = 'pending_notification_payload';
final SharedPreferences _prefs;
IOSNotificationPayloadBridge(this._prefs);
Future<ReminderPayload?> getPendingPayload() async {
final raw = _prefs.getString(_key);
if (raw == null || raw.isEmpty) {
return null;
}
try {
final json = Map<String, dynamic>.from(jsonDecode(raw) as Map);
return ReminderPayload.fromJson(json);
} catch (_) {
return null;
}
}
Future<void> clearPendingPayload() async {
await _prefs.remove(_key);
}
}