diff --git a/BUILD.md b/BUILD.md new file mode 100644 index 0000000..c0daae0 --- /dev/null +++ b/BUILD.md @@ -0,0 +1,5 @@ +1. Install Flutter SDK +2. Install Android SDK +3. Clone Repo +4. Run `compile.sh` +5. Check `releases/` Folder diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0dd07e4 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,66 @@ +# Changelog + +## 1.1.0 (In Development) + +Usability improvements. + +- move switchtile back to its own row + - allows showing text without crowding out or hiding minutes field +- fix monochrome icons, source was not white which may have been causing issues +- begin creating tar files for Linux rather than zips, will use zstd on release +- begin using a proper release signature rather that flutter's debug. +- update internal plugin versions. + +This version may require uninstalling any previous versions before updating +due to the signature change. It is a one-time event. + +## 1.0.1 (2026-09-29) + +Fixes for issues on hardware devices. + +- fix internet access on some devices +- fix SSL certificate issues on older devices +- fix null minutes making a null alarm time +- fix enabling alarm with no time set yet +- enhance the icon for older devices +- upgrade SDKs and compilers + +## 1.0.0 (2026-09-28) + +Completed the app for Android which also brings many benefits to the Linux version. + +**Android** + +- upgraded from single notification to alarm +- platform specific APK to help reduce file size + +**Both** + +- automatic dark theme if system is set to dark +- input validation on sunset time and minutes +- alarm now properly resets if time is changed +- add optional time picker for sunset time field +- only do the permission request on Android +- more consistent verbiage and text styling +- enhanced icon and added monochrome +- added file necessary for F-Droid repo +- updated flutter package versions + +This release has been tested tested tested, but only on emulators (x86_64). If you have any issues, please reach out. + +From now on only the arm64-v8a APK will be provided. + +## 0.1.2 (2026-09-28) + +- add icon +- fix notification on Android +- allow minutes to be 0 +- show toast if invalid minute value is provided +- enhance compile.sh to allow easier publications +- other small fixes and enhancements + +## 0.1.1 (2026-09-13) + +Linux version tested and now has alarm notification working. + +Android still needs testing and fixes. diff --git a/UPCOMING.md b/UPCOMING.md new file mode 100644 index 0000000..40a31ce --- /dev/null +++ b/UPCOMING.md @@ -0,0 +1,16 @@ +# To Be Done + +Upcoming feature list. All notes subject to change. + +## Patch + +- Change time grabber to a checkbox so that it stays up to date. + +## Minor + +- Cancel and reschedule alarm when minutes are changed. +- Add languages (Spanish, Croatian). + +## Major + +- Add sunrise section and retitle app to Sunshine Alarm. diff --git a/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png b/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png index da78661..189ff2b 100644 Binary files a/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png and b/android/app/src/main/res/mipmap-hdpi/ic_launcher_monochrome.png differ diff --git a/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png b/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png index 8e6a88d..280f8d4 100644 Binary files a/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png and b/android/app/src/main/res/mipmap-mdpi/ic_launcher_monochrome.png differ diff --git a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png index 01c41ec..e8282d1 100644 Binary files a/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png and b/android/app/src/main/res/mipmap-xhdpi/ic_launcher_monochrome.png differ diff --git a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png index 0b28acf..ae70661 100644 Binary files a/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png and b/android/app/src/main/res/mipmap-xxhdpi/ic_launcher_monochrome.png differ diff --git a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png index d8572ac..1d4e528 100644 Binary files a/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png and b/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher_monochrome.png differ diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index d6a1a9c..6b23797 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,7 +1,6 @@ #Sat Sep 12 19:36:23 MST 2026 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.0-bin.zip -#distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/settings.gradle.kts b/android/settings.gradle.kts index 2a9c2f5..94e510e 100644 --- a/android/settings.gradle.kts +++ b/android/settings.gradle.kts @@ -19,12 +19,11 @@ pluginManagement { plugins { id("dev.flutter.flutter-plugin-loader") version "1.0.0" - id("com.android.application") version "9.4.1" apply false - //id("com.android.application") version "9.0.1" apply false + id("com.android.application") version "9.5.0" apply false // This will need removed in Gradle/AGP 9. JK - needs to exist otherwiese: // "Error: Your project's Kotlin version (2.2.10) is lower than Flutter's minimum supported version of 2.2.20." - id("org.jetbrains.kotlin.android") version "2.4.20" apply false + id("org.jetbrains.kotlin.android") version "2.4.21" apply false } include(":app") diff --git a/compile.sh b/compile.sh index 956a5e9..aeda286 100755 --- a/compile.sh +++ b/compile.sh @@ -60,14 +60,29 @@ set -x flutter build linux ${BUILD_OPTIONS[@]} set +x -log "Saving Linux Bundle..." +log "- zip" filename=$RELEASE.linux-bundle.zip +contents="build/linux/x64/release/bundle/" if [[ -e $filename ]]; then rm -v $filename fi -zip -r $filename build/linux/x64/release/bundle/* +set -x +zip -qr "$filename" "$contents"/* +set +x ls -sh $filename +log "- tar" +filename=$RELEASE.linux-bundle.tar +if [[ -e "$filename"* ]]; then + rm -v "$filename"* +fi +set -x +tar -c --zstd -f "${filename}.zst" -C "$contents" . +tar -cz -f "${filename}.gz" -C "$contents" . +tar -cJ -f "${filename}.xz" -C "$contents" . +set +x +ls -sh "$filename"* | sort -h + # Android log "Building Universal APK..." @@ -99,9 +114,8 @@ for apk in `ls build/app/outputs/flutter-apk/app*release.apk`; do filename=`basename $apk` filename=${filename//app/${RELEASE}} cp -v "$apk" "$filename" - ls -sh "$filename" - echo " " done +ls -sh release/*.apk | sort -h # Finish diff --git a/lib/main.dart b/lib/main.dart index 8bd76ef..e15ad51 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -17,16 +17,6 @@ import 'dart:convert'; //import 'package:http/http.dart' as http; import 'package:flutter/services.dart' show rootBundle; -/// TBD: -/// - Add other languages (Spanish, Croatian) -/// v1.1.0 -/// - Move the switchtile back to its own row so that it handles titles better. -/// v1.2.0 -/// - Change sunset grabber to checkbox and retrieve it each alarm or open. -/// v2.0.0 -/// - Add sunrise section and change app name to Sunshine Alarm? -/// :TBD - void main() async { WidgetsFlutterBinding.ensureInitialized(); @@ -272,10 +262,11 @@ class _HomeScreenState extends State { ); } else if (Platform.isAndroid) { // Get the Notifications permission: - final android = _notifications - .resolvePlatformSpecificImplementation< - AndroidFlutterLocalNotificationsPlugin - >(); + final android = + _notifications + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin + >(); await android?.requestNotificationsPermission(); // Ensure that Android has the correct alarm permissions. @@ -493,9 +484,10 @@ class _HomeScreenState extends State { '${picked.hour.toString().padLeft(2, '0')}:' '${picked.minute.toString().padLeft(2, '0')}'; setState( - () => _sunsetErrorText = _validateTime( - _sunsetController.text, - ), + () => + _sunsetErrorText = _validateTime( + _sunsetController.text, + ), ); if (_alarmEnabled) { _scheduleAlarm(); @@ -523,13 +515,14 @@ class _HomeScreenState extends State { ), const SizedBox(width: 8), IconButton.filledTonal( - icon: _loading - ? const SizedBox( - width: 20, - height: 20, - child: CircularProgressIndicator(strokeWidth: 2), - ) - : const Icon(Icons.cloud_done_outlined), + icon: + _loading + ? const SizedBox( + width: 20, + height: 20, + child: CircularProgressIndicator(strokeWidth: 2), + ) + : const Icon(Icons.cloud_done_outlined), tooltip: 'Fetch Open-Meteo Sunset Data', onPressed: () { if (!_loading) { @@ -548,69 +541,50 @@ class _HomeScreenState extends State { const SizedBox(height: 8), // --- Minutes before --- - Row( - children: [ - if (!_alarmEnabled) - Expanded( - flex: 1, // _validTime ? 3 : 2, - child: TextField( - controller: _minutesController, - keyboardType: TextInputType.number, - decoration: InputDecoration( - border: OutlineInputBorder(), - labelText: 'Minutes Before Sunset', - errorText: _minuteErrorText, - ), - onChanged: (v) { - final val = int.tryParse(v); - setState(() { - if (val != null) { - _minuteErrorText = null; - _minutesBefore = val; - } else { - _minuteErrorText = 'Invalid Minute Value'; - } - _calcPlural(); - }); - }, - ), - ), + TextField( + controller: _minutesController, + keyboardType: TextInputType.number, + decoration: InputDecoration( + border: OutlineInputBorder(), + labelText: 'Minutes Before Sunset', + errorText: _minuteErrorText, + ), + onChanged: (v) { + final val = int.tryParse(v); + setState(() { + if (val != null) { + _minuteErrorText = null; + _minutesBefore = val; + } else { + _minuteErrorText = 'Invalid Minute Value'; + } + _calcPlural(); + }); + }, + ), - //Expanded( - // flex: 3, - // child: Center( - // child: - // _validTime ? Text("") : Text("Sunset Time Needed") , - // ), - //), - - // --- Toggle --- - Expanded( - flex: 1, //_validTime ? 2 : 5, - child: SwitchListTile( - title: Center( - child: Text( - _validTime - ? _alarmEnabled - ? "Sunset Alarm Enabled" - : "" //"Enable" - : "", // "Disabled", - ), - ), - subtitle: Center( - child: Text( - _validTime - ? _alarmEnabled - ? "${_minutesBefore} Minute${_plural} Before @ $_alarmDisplayTime" - : "" //"Sunset Alarm" - : "", //"Enter Valid Time", - ), - ), - value: _validTime ? _alarmEnabled : false, - onChanged: _validTime ? _toggleAlarm : null, - ), + // --- Toggle --- + SwitchListTile( + title: Center( + child: Text( + _validTime + ? _alarmEnabled + ? "Sunset Alarm Enabled" + : "Enable" + : "Disabled", ), - ], + ), + subtitle: Center( + child: Text( + _validTime + ? _alarmEnabled + ? "${_minutesBefore} Minute${_plural} Before @ $_alarmDisplayTime" + : "Sunset Alarm" + : "Enter Valid Time", + ), + ), + value: _validTime ? _alarmEnabled : false, + onChanged: _validTime ? _toggleAlarm : null, ), ], ), @@ -639,10 +613,11 @@ final _plugin = FlutterLocalNotificationsPlugin(); Future requestPermissions() async { if (Platform.isAndroid) { - final android = _plugin - .resolvePlatformSpecificImplementation< - AndroidFlutterLocalNotificationsPlugin - >(); + final android = + _plugin + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin + >(); // Android 13+ — standard notification permission (shows a dialog) await android?.requestNotificationsPermission(); @@ -652,7 +627,8 @@ Future requestPermissions() async { } } -final android = _plugin - .resolvePlatformSpecificImplementation< - AndroidFlutterLocalNotificationsPlugin - >(); +final android = + _plugin + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin + >(); diff --git a/media/icons/sunrise03_mc.png b/media/icons/sunrise03_mc.png index bfe805f..0cb3ff5 100644 Binary files a/media/icons/sunrise03_mc.png and b/media/icons/sunrise03_mc.png differ diff --git a/media/icons/sunrise03_mc.xcf b/media/icons/sunrise03_mc.xcf index 4c9a97f..cb8f253 100644 Binary files a/media/icons/sunrise03_mc.xcf and b/media/icons/sunrise03_mc.xcf differ diff --git a/pubspec.yaml b/pubspec.yaml index 3297e63..8c5597d 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: sunset_alarm description: "Set an alarm to go off a specified time before sunset." publish_to: 'none' -version: 1.0.1 +version: 1.1.0 environment: sdk: ^3.7.2