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:
@@ -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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user