main, change comments and UI text.
This commit is contained in:
1 parent
4788cdd220
commit
77320b05d6
1 file changed
+9
-10
+9
-10
@@ -12,8 +12,6 @@ import 'package:alarm/alarm.dart';
|
|||||||
import 'dart:convert';
|
import 'dart:convert';
|
||||||
|
|
||||||
/// TBD:
|
/// TBD:
|
||||||
/// v0.2.0
|
|
||||||
/// - Cancel the Android alarm when the toggle is unswitched.
|
|
||||||
/// v0.2.1
|
/// v0.2.1
|
||||||
/// - Fix time to get 0 prefixed if before 10:00 (5:30 becomes 05:30).
|
/// - Fix time to get 0 prefixed if before 10:00 (5:30 becomes 05:30).
|
||||||
/// - Fix time to validate properly rather than allowing garbage (error 530).
|
/// - Fix time to validate properly rather than allowing garbage (error 530).
|
||||||
@@ -275,13 +273,13 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
// Schedule:
|
// Schedule:
|
||||||
final settings = AlarmSettings(
|
final settings = AlarmSettings(
|
||||||
id: _alarmId,
|
id: _alarmId,
|
||||||
dateTime: alarmTime, // your computed sunset time
|
dateTime: alarmTime,
|
||||||
//assetAudioPath: 'assets/alarm.mp3', // put an alarm sound in assets/
|
//assetAudioPath: 'assets/alarm.mp3', // use default rather than custom
|
||||||
loopAudio: true, // keeps ringing until dismissed
|
loopAudio: true, // keeps ringing until dismissed
|
||||||
vibrate: true,
|
vibrate: true,
|
||||||
androidFullScreenIntent: true, // wakes screen like clock app
|
androidFullScreenIntent: true, // wakes screen like clock app
|
||||||
volumeSettings: VolumeSettings.fade(
|
volumeSettings: VolumeSettings.fade(
|
||||||
//volume: 0.8,
|
//volume: 0.8, // use default rather than custom
|
||||||
fadeDuration: Duration(seconds: 60),
|
fadeDuration: Duration(seconds: 60),
|
||||||
),
|
),
|
||||||
notificationSettings: NotificationSettings(
|
notificationSettings: NotificationSettings(
|
||||||
@@ -377,7 +375,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
const SizedBox(width: 8),
|
const SizedBox(width: 8),
|
||||||
IconButton.filledTonal(
|
IconButton.filledTonal(
|
||||||
icon: const Icon(Icons.my_location),
|
icon: const Icon(Icons.my_location),
|
||||||
tooltip: 'Get GPS location',
|
tooltip: 'Get GPS Location',
|
||||||
onPressed: _getGpsLocation,
|
onPressed: _getGpsLocation,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
@@ -396,7 +394,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
child: TextField(
|
child: TextField(
|
||||||
controller: _sunsetController,
|
controller: _sunsetController,
|
||||||
decoration: const InputDecoration(
|
decoration: const InputDecoration(
|
||||||
labelText: 'Sunset time (HH:MM)',
|
labelText: 'Sunset Time (HH:MM)',
|
||||||
border: OutlineInputBorder(),
|
border: OutlineInputBorder(),
|
||||||
),
|
),
|
||||||
onChanged: (_) => _savePrefs(),
|
onChanged: (_) => _savePrefs(),
|
||||||
@@ -412,19 +410,20 @@ class _HomeScreenState extends State<HomeScreen> {
|
|||||||
child: CircularProgressIndicator(strokeWidth: 2),
|
child: CircularProgressIndicator(strokeWidth: 2),
|
||||||
)
|
)
|
||||||
: const Icon(Icons.cloud_done_outlined),
|
: const Icon(Icons.cloud_done_outlined),
|
||||||
tooltip: 'Fetch sunset from Open-Meteo',
|
tooltip: 'Fetch Sunset Time from Open-Meteo',
|
||||||
onPressed: _loading ? null : _fetchSunset,
|
onPressed: _loading ? null : _fetchSunset,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 16),
|
const SizedBox(height: 16),
|
||||||
|
|
||||||
// --- Minutes before ---
|
|
||||||
const Text(
|
const Text(
|
||||||
'Alert Before Sunset',
|
'Alert',
|
||||||
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
||||||
),
|
),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
|
|
||||||
|
// --- Minutes before ---
|
||||||
Row(
|
Row(
|
||||||
children: [
|
children: [
|
||||||
const Text('Minutes before: '),
|
const Text('Minutes before: '),
|
||||||
|
|||||||
Reference in new issue
Block a user