feat:增加日程模块
This commit is contained in:
@@ -95,7 +95,6 @@ class NotifyService {
|
||||
required String body,
|
||||
required DateTime scheduledTime,
|
||||
}) async {
|
||||
print("scheduleNotification: $id");
|
||||
await _notifications.zonedSchedule(
|
||||
id,
|
||||
title,
|
||||
@@ -110,8 +109,11 @@ class NotifyService {
|
||||
|
||||
// 取消特定通知
|
||||
Future<void> cancelNotification(int id) async {
|
||||
print("cancelNotification: $id");
|
||||
await _notifications.cancel(id);
|
||||
try {
|
||||
await _notifications.cancel(id);
|
||||
} catch(e) {
|
||||
print('取消通知失败: $e');
|
||||
}
|
||||
}
|
||||
|
||||
// 取消所有通知
|
||||
|
||||
Reference in New Issue
Block a user