feat:增加日志记录
This commit is contained in:
@@ -4,6 +4,7 @@ import 'package:flisp_app/service/calendar_service.dart';
|
||||
import 'package:flisp_app/service/todo_service.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_common/utils/date_utils.dart';
|
||||
import 'package:flutter_common/utils/log_utils.dart';
|
||||
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:timezone/data/latest_all.dart' as tz;
|
||||
import 'package:timezone/timezone.dart' as tz;
|
||||
@@ -55,6 +56,7 @@ class NotifyService {
|
||||
|
||||
/// 重新刷新提醒 防止每次重启设备后提醒丢失的问题
|
||||
void _refreshScheduled() async {
|
||||
logger.i('开始刷新提醒');
|
||||
await cancelAllNotifications();
|
||||
|
||||
TodoService todoService = TodoService();
|
||||
@@ -77,6 +79,8 @@ class NotifyService {
|
||||
);
|
||||
}
|
||||
|
||||
logger.i('刷新 ${todayTodos.length}个 待办提醒');
|
||||
|
||||
CalendarService calendarService = CalendarService();
|
||||
final List<Calendar> calendarResult = calendarService.getAllCalendars();
|
||||
final List<Calendar> todayCalendars =
|
||||
@@ -92,6 +96,9 @@ class NotifyService {
|
||||
scheduledTime: calendar.scheduledTime!,
|
||||
);
|
||||
}
|
||||
|
||||
logger.i('刷新 ${todayCalendars.length}个 日程提醒');
|
||||
logger.i('结束刷新提醒');
|
||||
}
|
||||
|
||||
// 创建Android通知详情
|
||||
@@ -157,7 +164,7 @@ class NotifyService {
|
||||
try {
|
||||
await _notifications.cancel(id);
|
||||
} catch (e) {
|
||||
print('取消通知失败: $e');
|
||||
logger.i('取消通知失败: $e');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user