fix: initialize reminder channel and clarify notification permission diagnostics
This commit is contained in:
@@ -69,6 +69,9 @@ class _ReminderToolsState extends State<ReminderTools> {
|
||||
'reminderStatus': c.reminderResult.status.name,
|
||||
for (final key in [
|
||||
'notifications',
|
||||
'appNotificationsEnabled',
|
||||
'channelExists',
|
||||
'courseChannelEnabled',
|
||||
'exactAlarm',
|
||||
'pendingCount',
|
||||
'channelImportance',
|
||||
@@ -125,8 +128,16 @@ class _ReminderToolsState extends State<ReminderTools> {
|
||||
final rawSystem = diagnosis['system'];
|
||||
final system = rawSystem is Map ? rawSystem : const {};
|
||||
final pending = diagnosis['pendingCount'];
|
||||
final sdk = system['sdk'];
|
||||
final channelsSupported = sdk is! int || sdk >= 26;
|
||||
return [
|
||||
'通知权限:${_permission(diagnosis['notifications'])}',
|
||||
if (diagnosis['appNotificationsEnabled'] is bool)
|
||||
'系统通知总开关:${_permission(diagnosis['appNotificationsEnabled'])}',
|
||||
if (channelsSupported && diagnosis['channelExists'] == true)
|
||||
'课前提醒类别:${_permission(diagnosis['courseChannelEnabled'])}',
|
||||
if (channelsSupported && diagnosis['channelExists'] == false)
|
||||
'课前提醒类别尚未建立,请重新打开应用后检查。',
|
||||
'精确提醒:${_permission(diagnosis['exactAlarm'])}',
|
||||
if (pending is int) '待发送提醒:$pending 条',
|
||||
if (diagnosis['notifications'] == false) '系统通知已关闭,请在通知设置中开启。',
|
||||
|
||||
Reference in New Issue
Block a user