4b29b300da
- 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
32 lines
733 B
Dart
32 lines
733 B
Dart
import 'models/reminder_payload.dart';
|
|
|
|
class ReminderQueueManager {
|
|
ReminderPayload? _currentPayload;
|
|
final List<ReminderPayload> _pending = [];
|
|
|
|
void enqueueFromClick(ReminderPayload payload) {
|
|
_currentPayload = payload;
|
|
}
|
|
|
|
void enqueuePending(List<ReminderPayload> payloads) {
|
|
payloads.sort((a, b) => a.startAt.compareTo(b.startAt));
|
|
_pending.addAll(payloads);
|
|
}
|
|
|
|
ReminderPayload? get currentPayload => _currentPayload;
|
|
|
|
bool get isEmpty => _currentPayload == null && _pending.isEmpty;
|
|
|
|
void dequeueCurrent() {
|
|
_currentPayload = null;
|
|
if (_pending.isNotEmpty) {
|
|
_currentPayload = _pending.removeAt(0);
|
|
}
|
|
}
|
|
|
|
void clear() {
|
|
_currentPayload = null;
|
|
_pending.clear();
|
|
}
|
|
}
|