1.0.0 #2

Merged
me merged 26 commits from dev into main 2026-09-28 10:50:03 -07:00
Showing only changes of commit 39792270f1 - Show all commits
+21 -12
View File
@@ -66,6 +66,9 @@ class _HomeScreenState extends State<HomeScreen> {
int _minutesBefore = 30; int _minutesBefore = 30;
bool _loading = false; bool _loading = false;
String? _sunsetErrorText = null;
String? _minuteErrorText = null;
static const _alarmId = 1001; static const _alarmId = 1001;
@override @override
@@ -426,40 +429,46 @@ class _HomeScreenState extends State<HomeScreen> {
// --- Minutes before --- // --- Minutes before ---
Row( Row(
children: [ children: [
const Text('Minutes before: '), if (!_alarmEnabled)
SizedBox( Expanded(
width: 80,
child: TextField( child: TextField(
controller: _minutesController, controller: _minutesController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: const InputDecoration( decoration: InputDecoration(
border: OutlineInputBorder(), border: OutlineInputBorder(),
labelText: 'Minutes Before Sunset',
errorText: _minuteErrorText,
), ),
onChanged: (v) { onChanged: (v) {
final val = int.tryParse(v); final val = int.tryParse(v);
if (val != null && val >= 0) { setState(() {
if (val != null) {
_minuteErrorText = null;
_minutesBefore = val; _minutesBefore = val;
} else { } else {
_showSnack('Invalid Minute Value'); _minuteErrorText = 'Invalid Minute Value';
} }
});
}, },
), ),
), ),
],
),
const SizedBox(height: 24),
// --- Toggle --- // --- Toggle ---
SwitchListTile( Expanded(
title: const Text('Enable Sunset Alarm'), child: SwitchListTile(
//title: const Text('Enable Sunset Alarm'),
title: Text(_alarmEnabled ? 'Sunset Alarm Enabled' : ''),
subtitle: Text( subtitle: Text(
_alarmEnabled _alarmEnabled
? 'Will alert ${_minutesBefore} min before sunset. ($_alarmDisplayTime)' ? 'Will alert ${_minutesBefore} min before sunset. ($_alarmDisplayTime)'
: 'Alarm is off', : '',
), ),
value: _alarmEnabled, value: _alarmEnabled,
onChanged: _toggleAlarm, onChanged: _toggleAlarm,
), ),
),
],
),
], ],
), ),
), ),