23 Commits
Author SHA1 Message Date
me 17d69fb3a7 pubspec, increment version. 2026-11-11 08:45:16 -07:00
me b6ae6b1f10 changelog, add working version. 2026-11-11 08:44:49 -07:00
me b02ca20072 Merge branch 'main' into dev 2026-11-11 08:42:02 -07:00
me e04aa9f447 main, ensure the alarm ID gets refreshed on the screen by using setState() at the end of the function. 2026-11-11 08:36:26 -07:00
me 3bb3123a12 main, add alarm ID to switch text for now so we can see which date it's for. 2026-11-11 08:24:04 -07:00
me f0b723e158 main, fix rescheduling by making each day's alarm ID unique so that it does not cancel the alarm currently going off. 2026-11-11 08:14:47 -07:00
me 8adaecbf7d Android Studio or Flutter changes. 2026-11-11 08:13:50 -07:00
me f212f9927b Upgrade AGP. 2026-11-11 08:13:28 -07:00
me 08e9ff66b7 Upgrade Gradle (9.8.2 -> 9.9.0). 2026-11-10 20:35:04 -07:00
me cfd0ca514d settings, fix typo in comment. 2026-11-10 20:34:30 -07:00
me 66f42a5141 build, add flutter proguard file. 2026-11-10 20:34:04 -07:00
me e163a2e290 main, add output to see if the alarm going off really does schedule the next alarm. 2026-11-10 20:33:33 -07:00
me 7eaa2dc3a4 main, attempt to reschedule alarm for next day after the current day goes off. 2026-11-10 19:57:33 -07:00
me f432e0b406 changelog, update to match releases page. 2026-11-01 18:59:35 -07:00
me 220df450c3 gitignore, add more Android build and release locations. 2026-11-01 15:59:34 -07:00
me 14c75e8331 gitignore, add release and build files. 2026-11-01 15:07:45 -07:00
me eafa6ffa5f changelog, update to match release. 2026-11-01 15:07:31 -07:00
me 4b877f3807 Merge pull request '1.1.0' (#4) from dev into main
Reviewed-on: #4
2026-11-01 14:27:23 -07:00
me 4591dc591d upcoming, reword the versions since not all came to fruition. 2026-11-01 14:22:34 -07:00
me 86069dce2f Update changelog. 2026-11-01 14:10:28 -07:00
me 6b7b91daac Update Gradle. 2026-11-01 14:08:18 -07:00
me c61521c4d7 gradle, update AGP and Kotlin. 2026-11-01 14:07:54 -07:00
me 9b5162216e Update version. 2026-11-01 14:07:28 -07:00
8 changed files with 89 additions and 23 deletions

No files matched your search

+7
View File
@@ -57,6 +57,10 @@ unlinked_spec.ds
**/android/**/GeneratedPluginRegistrant.java
**/android/key.properties
*.jks
android/build
android/app/build
android/release
android/app/release
# iOS/XCode related
**/ios/**/*.mode1v3
@@ -122,6 +126,9 @@ app.*.symbols
# Gradle files
.gradle/
build/
android/app/release/*
android/build/*
android/app/build/*
# Local configuration file (sdk path, etc)
local.properties
+11 -2
View File
@@ -1,13 +1,22 @@
# Changelog
## 1.1.0 (In Development)
## 1.2.0 (In Development)
- Automatically enable next day's alarm when the current day's is activated.
- Add the alarm's date to the SwitchTile text for confirming it's truly set.
## 1.1.0 (2026-11-01)
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 creating tar files for Linux rather than zips to use 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)
+6 -6
View File
@@ -2,15 +2,15 @@
Upcoming feature list. All notes subject to change.
## v1.1.0
## 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).
## v1.2.0
- Change time grabber to a checkbox so that it stays up to date.
## 2.0.0 (In Design)
## Major
- Add sunrise section and retitle app to Sunshine Alarm.
+2 -1
View File
@@ -55,7 +55,8 @@ android {
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
"proguard-rules.pro",
"flutter_proguard_rules.pro"
)
/// 20260928 - With minifying, helped some, but also used
+5 -2
View File
@@ -1,6 +1,9 @@
#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.9.0-bin.zip
networkTimeout=10000
retries=0
retryBackOffMs=500
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
+3 -3
View File
@@ -19,11 +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.5.1" apply false
// This will need removed in Gradle/AGP 9. JK - needs to exist otherwiese:
// This will need removed in Gradle/AGP 9. JK - needs to exist otherwise:
// "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")
+54 -8
View File
@@ -1,6 +1,7 @@
import 'dart:io';
import 'dart:async';
import 'package:alarm/utils/alarm_set.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:shared_preferences/shared_preferences.dart';
@@ -29,6 +30,7 @@ void main() async {
tz.initializeTimeZones();
await Alarm.init();
runApp(const SunsetAlarmApp());
}
@@ -61,6 +63,11 @@ class SunsetAlarmApp extends StatelessWidget {
}
}
int dateAsId(DateTime d) => d.year * 10000 + d.month * 100 + d.day;
int todayAsId() {
return dateAsId(DateTime.now());
}
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@@ -86,20 +93,30 @@ class _HomeScreenState extends State<HomeScreen> {
String? _minuteErrorText;
bool _validTime = false;
static const _alarmId = 1001;
int _alarmId = 20260000;
@override
void initState() {
super.initState();
_initNotifications();
_loadPrefs();
// Reschedule alarm any time one goes off.
Alarm.ringing.listen((AlarmSet alarmSet) {
for (final alarm in alarmSet.alarms) {
if (alarm.id == todayAsId()) {
_scheduleAlarm();
break;
}
}
});
}
Future<void> _initNotifications() async {
const androidInit = AndroidInitializationSettings('@mipmap/ic_launcher');
const iosInit = DarwinInitializationSettings();
const linuxInit = LinuxInitializationSettings(
defaultActionName: 'Sunset Alarm',
defaultActionName: 'Sunset Alarm ',
);
await _notifications.initialize(
settings: const InitializationSettings(
@@ -240,6 +257,10 @@ class _HomeScreenState extends State<HomeScreen> {
alarmTime = alarmTime.add(const Duration(days: 1));
}
_debug("_scheduleAlarm, alarmTime=${alarmTime.toIso8601String()}");
_alarmId = dateAsId(alarmTime);
_debug("_alarmId=$_alarmId");
if (Platform.isLinux) {
// Linux: use a Timer (app must stay open)
_alarmTimer?.cancel();
@@ -300,9 +321,9 @@ class _HomeScreenState extends State<HomeScreen> {
androidScheduleMode: AndroidScheduleMode.alarmClock,
);
_showSnack('Alarm scheduled!');
debugPrint('DEBUG: Alarm time: ${tzAlarm.toString()}');
debugPrint('DEBUG: Current time: ${DateTime.now().toUtc().toString()}');
debugPrint('DEBUG: ${_notifications.toString()}');
_debug('Alarm time: ${tzAlarm.toString()}');
_debug('Current time: ${DateTime.now().toUtc().toString()}');
_debug('${_notifications.toString()}');
}
// End Notification Method ***/
@@ -327,6 +348,16 @@ class _HomeScreenState extends State<HomeScreen> {
icon: 'ic_notification',
),
);
// Skip if tomorrow's alarm already exists.
final existing = await Alarm.getAlarm(_alarmId);
if (existing == settings) {
_debug(
"Alarm already exists, skipping schedule. ${settings.toString()}",
);
return;
}
await Alarm.set(alarmSettings: settings);
}
// End Alarm Method ***/
@@ -334,6 +365,10 @@ class _HomeScreenState extends State<HomeScreen> {
} else {
_showSnack('Platform Not Detected - Contact Developer');
}
// If we made it this far, refresh the alarm ID on the screen.
setState(() {
_alarmId = _alarmId;
});
}
Future<void> _toggleAlarm(bool value) async {
@@ -352,11 +387,13 @@ class _HomeScreenState extends State<HomeScreen> {
} else if (Platform.isAndroid) {
// Notification Method
if (ANDROID_USE_NOTIF) {
await _notifications.cancel(id: _alarmId);
//await _notifications.cancel(id: _alarmId);
await _notifications.cancelAll();
}
// Alarm Method
if (ANDROID_USE_ALARM) {
await Alarm.stop(_alarmId);
//await Alarm.stop(_alarmId);
await Alarm.stopAll();
}
}
_showSnack('Alarm Cancelled');
@@ -366,6 +403,14 @@ class _HomeScreenState extends State<HomeScreen> {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(msg)));
}
void _log(String tag, String msg) {
debugPrint(tag + ": " + msg);
}
void _debug(String msg) {
_log("DEBUG", msg);
}
@override
void dispose() {
_savePrefs();
@@ -578,10 +623,11 @@ class _HomeScreenState extends State<HomeScreen> {
child: Text(
_validTime
? _alarmEnabled
? "${_minutesBefore} Minute${_plural} Before @ $_alarmDisplayTime"
? "${_minutesBefore} Minute${_plural} Before @ $_alarmId $_alarmDisplayTime"
: "Sunset Alarm"
: "Enter Valid Time",
),
// .toString().replaceRange(4, 4, '-').replaceRange(7, 7, '-')
),
value: _validTime ? _alarmEnabled : false,
onChanged: _validTime ? _toggleAlarm : null,
+1 -1
View File
@@ -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.2.0
environment:
sdk: ^3.7.2