Fix release notification resource and add multiple advance reminders

This commit is contained in:
Codex
2026-10-14 11:30:37 +08:00
parent caf7abe0c0
commit 4d86db3dd5
16 changed files with 350 additions and 58 deletions
+21 -9
View File
@@ -324,17 +324,29 @@ class _SettingsPageState extends State<SettingsPage> {
spacing: 6,
runSpacing: 7,
children: [
for (final minutes in [5, 10, 15, 30, 60])
ChoiceChip(
for (final minutes in AppSettings.allowedReminderMinutes)
FilterChip(
label: Text('$minutes 分钟'),
selected: s.reminderMinutes == minutes,
selected: s.reminderOffsets.contains(minutes),
onSelected: c.isDemo
? null
: (_) => c.updateSettings(
(current) => current.copyWith(
reminderMinutes: minutes,
),
),
: (selected) {
if (!selected &&
s.reminderOffsets.length == 1) {
_notice('请至少保留一个提醒时间');
return;
}
c.updateSettings(
(current) => current.copyWith(
reminderOffsets: [
for (final value
in current.reminderOffsets)
if (value != minutes) value,
if (selected) minutes,
],
),
);
},
),
],
),
@@ -345,7 +357,7 @@ class _SettingsPageState extends State<SettingsPage> {
: c.reminderResult.status ==
ReminderStatus.permissionDenied
? '尚未允许通知权限,点击下方按钮开启。'
: '连续课程只在开始前提醒一次。',
: '可多选提前时间,连续课程按每个选中的时间提醒。',
style: TextStyle(
fontSize: 11,
height: 1.6,