main, continue ensuring actual alarm gets changed if sunset time is changed, add reference to notification icon.

This commit is contained in:
me committed 2026-09-28 08:27:45 -07:00
1 parent 4926c869b9
commit 8167c748ff
1 file changed
+8 -3
+8 -3
View File
@@ -193,6 +193,10 @@ class _HomeScreenState extends State<HomeScreen> {
} finally {
setState(() => _loading = false);
}
if (_alarmEnabled) {
_scheduleAlarm();
}
}
Timer? _alarmTimer;
@@ -303,6 +307,7 @@ class _HomeScreenState extends State<HomeScreen> {
title: 'Sunset Alarm',
body: 'Sun is setting in ${_minutesBefore} minute(s)!',
stopButton: 'Dismiss',
icon: 'ic_notification',
),
);
await Alarm.set(alarmSettings: settings);
@@ -444,6 +449,9 @@ class _HomeScreenState extends State<HomeScreen> {
_sunsetController.text,
),
);
if (_alarmEnabled) {
_scheduleAlarm();
}
}
},
),
@@ -476,9 +484,6 @@ class _HomeScreenState extends State<HomeScreen> {
onPressed: () {
if (!_loading) {
_fetchSunset();
if (_alarmEnabled) {
_scheduleAlarm();
}
}
},
),