1.1.0 #4

Merged
me merged 23 commits from dev into main 2026-11-01 14:27:25 -07:00
Showing only changes of commit 77e964a4c7 - Show all commits
+16 -30
View File
@@ -272,7 +272,8 @@ class _HomeScreenState extends State<HomeScreen> {
); );
} else if (Platform.isAndroid) { } else if (Platform.isAndroid) {
// Get the Notifications permission: // Get the Notifications permission:
final android = _notifications final android =
_notifications
.resolvePlatformSpecificImplementation< .resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin AndroidFlutterLocalNotificationsPlugin
>(); >();
@@ -493,7 +494,8 @@ class _HomeScreenState extends State<HomeScreen> {
'${picked.hour.toString().padLeft(2, '0')}:' '${picked.hour.toString().padLeft(2, '0')}:'
'${picked.minute.toString().padLeft(2, '0')}'; '${picked.minute.toString().padLeft(2, '0')}';
setState( setState(
() => _sunsetErrorText = _validateTime( () =>
_sunsetErrorText = _validateTime(
_sunsetController.text, _sunsetController.text,
), ),
); );
@@ -523,7 +525,8 @@ class _HomeScreenState extends State<HomeScreen> {
), ),
const SizedBox(width: 8), const SizedBox(width: 8),
IconButton.filledTonal( IconButton.filledTonal(
icon: _loading icon:
_loading
? const SizedBox( ? const SizedBox(
width: 20, width: 20,
height: 20, height: 20,
@@ -548,12 +551,7 @@ class _HomeScreenState extends State<HomeScreen> {
const SizedBox(height: 8), const SizedBox(height: 8),
// --- Minutes before --- // --- Minutes before ---
Row( TextField(
children: [
if (!_alarmEnabled)
Expanded(
flex: 1, // _validTime ? 3 : 2,
child: TextField(
controller: _minutesController, controller: _minutesController,
keyboardType: TextInputType.number, keyboardType: TextInputType.number,
decoration: InputDecoration( decoration: InputDecoration(
@@ -574,27 +572,16 @@ class _HomeScreenState extends State<HomeScreen> {
}); });
}, },
), ),
),
//Expanded(
// flex: 3,
// child: Center(
// child:
// _validTime ? Text("") : Text("Sunset Time Needed") ,
// ),
//),
// --- Toggle --- // --- Toggle ---
Expanded( SwitchListTile(
flex: 1, //_validTime ? 2 : 5,
child: SwitchListTile(
title: Center( title: Center(
child: Text( child: Text(
_validTime _validTime
? _alarmEnabled ? _alarmEnabled
? "Sunset Alarm Enabled" ? "Sunset Alarm Enabled"
: "" //"Enable" : "Enable"
: "", // "Disabled", : "Disabled",
), ),
), ),
subtitle: Center( subtitle: Center(
@@ -602,16 +589,13 @@ class _HomeScreenState extends State<HomeScreen> {
_validTime _validTime
? _alarmEnabled ? _alarmEnabled
? "${_minutesBefore} Minute${_plural} Before @ $_alarmDisplayTime" ? "${_minutesBefore} Minute${_plural} Before @ $_alarmDisplayTime"
: "" //"Sunset Alarm" : "Sunset Alarm"
: "", //"Enter Valid Time", : "Enter Valid Time",
), ),
), ),
value: _validTime ? _alarmEnabled : false, value: _validTime ? _alarmEnabled : false,
onChanged: _validTime ? _toggleAlarm : null, onChanged: _validTime ? _toggleAlarm : null,
), ),
),
],
),
], ],
), ),
), ),
@@ -639,7 +623,8 @@ final _plugin = FlutterLocalNotificationsPlugin();
Future<void> requestPermissions() async { Future<void> requestPermissions() async {
if (Platform.isAndroid) { if (Platform.isAndroid) {
final android = _plugin final android =
_plugin
.resolvePlatformSpecificImplementation< .resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin AndroidFlutterLocalNotificationsPlugin
>(); >();
@@ -652,7 +637,8 @@ Future<void> requestPermissions() async {
} }
} }
final android = _plugin final android =
_plugin
.resolvePlatformSpecificImplementation< .resolvePlatformSpecificImplementation<
AndroidFlutterLocalNotificationsPlugin AndroidFlutterLocalNotificationsPlugin
>(); >();