refactor(apps): 主题系统迁移至 ColorScheme + 扩展架构并支持 Dark Mode
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import '../../../calendar/data/services/calendar_service.dart';
|
||||
import '../../data/services/local_notification_service.dart';
|
||||
import '../../../../data/services/calendar_service.dart';
|
||||
import '../../../../data/models/reminder_payload.dart';
|
||||
import '../../../../data/repositories/models/schedule_item_model.dart';
|
||||
import '../../../../data/services/local_notification_service.dart';
|
||||
import '../models/reminder_action.dart';
|
||||
import '../models/reminder_payload.dart';
|
||||
|
||||
class ReminderActionExecutor {
|
||||
final CalendarService _calendarService;
|
||||
@@ -39,8 +40,11 @@ class ReminderActionExecutor {
|
||||
}
|
||||
|
||||
Future<void> _snoozeEvent(String eventId) async {
|
||||
final event = await _calendarService.getEventById(eventId);
|
||||
if (event == null) {
|
||||
late final ScheduleItemModel event;
|
||||
try {
|
||||
event = await _calendarService.getEventById(eventId);
|
||||
} catch (_) {
|
||||
await _notificationService.cancelEventReminder(eventId);
|
||||
return;
|
||||
}
|
||||
final now = DateTime.now();
|
||||
@@ -62,6 +66,10 @@ class ReminderActionExecutor {
|
||||
}
|
||||
|
||||
Future<void> _archiveEvent(String eventId) async {
|
||||
await _calendarService.archiveEvent(eventId);
|
||||
try {
|
||||
await _calendarService.archiveEvent(eventId);
|
||||
} catch (_) {
|
||||
await _notificationService.cancelEventReminder(eventId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import '../models/reminder_payload.dart';
|
||||
import '../../../../data/models/reminder_payload.dart';
|
||||
|
||||
class ReminderQueueManager {
|
||||
ReminderPayload? _currentPayload;
|
||||
|
||||
Reference in New Issue
Block a user