9 Commits
20 changed files with 95 additions and 58 deletions

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
# flutter_sunset_alarm
# sunset_alarm
Android app to set off an alarm a set number of hours before sunset if enabled
manually or if the user has wandered a set distance away from the sunset
+9
View File
@@ -1 +1,10 @@
analyzer:
exclude:
- build/**
- android/**
- ios/**
- web/**
- windows/**
- macos/**
- linux/**
include: package:flutter_lints/flutter.yaml
+20 -7
View File
@@ -1,27 +1,36 @@
plugins {
id("com.android.application")
id("kotlin-android")
// This will need removed in Gradle/AGP 9.
id("org.jetbrains.kotlin.android") // id("kotlin-android")
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id("dev.flutter.flutter-gradle-plugin")
}
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
android {
namespace = "com.example.flutter_sunset_alarm"
namespace = "com.hyperling.sunset_alarm"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion
compileOptions {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
isCoreLibraryDesugaringEnabled = true
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}
kotlinOptions {
jvmTarget = JavaVersion.VERSION_11.toString()
// This will need removed in Gradle/AGP 9.
kotlin {
compilerOptions {
jvmTarget.set(JvmTarget.JVM_17)
}
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId = "com.example.flutter_sunset_alarm"
applicationId = "com.hyperling.sunset_alarm"
// You can update the following values to match your application needs.
// For more information, see: https://flutter.dev/to/review-gradle-config.
minSdk = flutter.minSdkVersion
@@ -39,6 +48,10 @@ android {
}
}
dependencies {
coreLibraryDesugaring("com.android.tools:desugar_jdk_libs:2.1.4")
}
flutter {
source = "../.."
}
+2 -2
View File
@@ -1,6 +1,6 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application
android:label="flutter_sunset_alarm"
android:label="sunset_alarm"
android:name="${applicationName}"
android:icon="@mipmap/ic_launcher">
<activity
@@ -46,5 +46,5 @@
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>
<uses-permission android:name="android.permission.POST_NOTIFICATIONS"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
<uses-permission android:name="android.permission.SCHEDULE_EXACT_ALARM"/>
</manifest>
@@ -1,4 +1,4 @@
package com.example.flutter_sunset_alarm
package com.hyperling.sunset_alarm
import io.flutter.embedding.android.FlutterActivity
+4
View File
@@ -1,3 +1,7 @@
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
# This builtInKotlin flag was added automatically by Flutter migrator
android.builtInKotlin=false
# This newDsl flag was added automatically by Flutter migrator
android.newDsl=false
+3 -1
View File
@@ -1,5 +1,7 @@
#Sat Sep 12 19:36:23 MST 2026
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-9.6.0-bin.zip
#distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
+6 -2
View File
@@ -18,8 +18,12 @@ pluginManagement {
plugins {
id("dev.flutter.flutter-plugin-loader") version "1.0.0"
id("com.android.application") version "8.7.0" apply false
id("org.jetbrains.kotlin.android") version "1.8.22" apply false
id("com.android.application") version "9.4.0" apply false
//id("com.android.application") version "9.0.1" apply false
// This will need removed in Gradle/AGP 9.
id("org.jetbrains.kotlin.android") version "2.4.20" apply false
}
include(":app")
+1 -1
View File
@@ -13,7 +13,7 @@
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>flutter_sunset_alarm</string>
<string>sunset_alarm</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
+22 -17
View File
@@ -1,3 +1,4 @@
import 'dart:io';
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
@@ -8,8 +9,6 @@ import 'package:timezone/timezone.dart' as tz;
import 'package:http/http.dart' as http;
import 'dart:convert';
import 'dart:io';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
tz.initializeTimeZones();
@@ -64,8 +63,15 @@ class _HomeScreenState extends State<HomeScreen> {
Future<void> _initNotifications() async {
const androidInit = AndroidInitializationSettings('@mipmap/ic_launcher');
const iosInit = DarwinInitializationSettings();
const linuxInit = LinuxInitializationSettings(
defaultActionName: 'Sunset Alarm',
);
await _notifications.initialize(
const InitializationSettings(android: androidInit, iOS: iosInit),
const InitializationSettings(
android: androidInit,
iOS: iosInit,
linux: linuxInit,
),
);
}
@@ -375,22 +381,21 @@ class _HomeScreenState extends State<HomeScreen> {
},
),
),
const SizedBox(height: 24),
// --- Toggle ---
SwitchListTile(
title: const Text('Enable Sunset Alarm'),
subtitle: Text(
_alarmEnabled
? 'Will alert ${_minutesBefore} min before sunset. ($_alarmDisplayTime)'
: 'Alarm is off',
),
value: _alarmEnabled,
onChanged: _toggleAlarm,
),
],
),
const SizedBox(height: 24),
// --- Toggle ---
SwitchListTile(
title: const Text('Enable Sunset Alarm'),
subtitle: Text(
_alarmEnabled
? 'Will alert ${_minutesBefore} min before sunset. ($_alarmDisplayTime)'
: 'Alarm is off',
),
value: _alarmEnabled,
onChanged: _toggleAlarm,
),
],
),
),
+2 -2
View File
@@ -4,10 +4,10 @@ project(runner LANGUAGES CXX)
# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "flutter_sunset_alarm")
set(BINARY_NAME "sunset_alarm")
# The unique GTK application identifier for this application. See:
# https://wiki.gnome.org/HowDoI/ChooseApplicationID
set(APPLICATION_ID "com.example.flutter_sunset_alarm")
set(APPLICATION_ID "com.hyperling.sunset_alarm")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.
+2 -2
View File
@@ -40,11 +40,11 @@ static void my_application_activate(GApplication* application) {
if (use_header_bar) {
GtkHeaderBar* header_bar = GTK_HEADER_BAR(gtk_header_bar_new());
gtk_widget_show(GTK_WIDGET(header_bar));
gtk_header_bar_set_title(header_bar, "flutter_sunset_alarm");
gtk_header_bar_set_title(header_bar, "sunset_alarm");
gtk_header_bar_set_show_close_button(header_bar, TRUE);
gtk_window_set_titlebar(window, GTK_WIDGET(header_bar));
} else {
gtk_window_set_title(window, "flutter_sunset_alarm");
gtk_window_set_title(window, "sunset_alarm");
}
gtk_window_set_default_size(window, 1280, 720);
+6 -6
View File
@@ -64,7 +64,7 @@
331C80D7294CF71000263BE5 /* RunnerTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RunnerTests.swift; sourceTree = "<group>"; };
333000ED22D3DE5D00554162 /* Warnings.xcconfig */ = {isa = PBXFileReference; lastKnownFileType = text.xcconfig; path = Warnings.xcconfig; sourceTree = "<group>"; };
335BBD1A22A9A15E00E9071D /* GeneratedPluginRegistrant.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GeneratedPluginRegistrant.swift; sourceTree = "<group>"; };
33CC10ED2044A3C60003C045 /* flutter_sunset_alarm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "flutter_sunset_alarm.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10ED2044A3C60003C045 /* sunset_alarm.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "sunset_alarm.app"; sourceTree = BUILT_PRODUCTS_DIR; };
33CC10F02044A3C60003C045 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
33CC10F22044A3C60003C045 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; name = Assets.xcassets; path = Runner/Assets.xcassets; sourceTree = "<group>"; };
33CC10F52044A3C60003C045 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/MainMenu.xib; sourceTree = "<group>"; };
@@ -131,7 +131,7 @@
33CC10EE2044A3C60003C045 /* Products */ = {
isa = PBXGroup;
children = (
33CC10ED2044A3C60003C045 /* flutter_sunset_alarm.app */,
33CC10ED2044A3C60003C045 /* sunset_alarm.app */,
331C80D5294CF71000263BE5 /* RunnerTests.xctest */,
);
name = Products;
@@ -217,7 +217,7 @@
);
name = Runner;
productName = Runner;
productReference = 33CC10ED2044A3C60003C045 /* flutter_sunset_alarm.app */;
productReference = 33CC10ED2044A3C60003C045 /* sunset_alarm.app */;
productType = "com.apple.product-type.application";
};
/* End PBXNativeTarget section */
@@ -388,7 +388,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterSunsetAlarm.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_sunset_alarm.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_sunset_alarm";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/sunset_alarm.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/sunset_alarm";
};
name = Debug;
};
@@ -402,7 +402,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterSunsetAlarm.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_sunset_alarm.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_sunset_alarm";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/sunset_alarm.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/sunset_alarm";
};
name = Release;
};
@@ -416,7 +416,7 @@
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterSunsetAlarm.RunnerTests;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/flutter_sunset_alarm.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/flutter_sunset_alarm";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/sunset_alarm.app/$(BUNDLE_EXECUTABLE_FOLDER_PATH)/sunset_alarm";
};
name = Profile;
};
@@ -15,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flutter_sunset_alarm.app"
BuildableName = "sunset_alarm.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
@@ -31,7 +31,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flutter_sunset_alarm.app"
BuildableName = "sunset_alarm.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
@@ -66,7 +66,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flutter_sunset_alarm.app"
BuildableName = "sunset_alarm.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
@@ -83,7 +83,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "33CC10EC2044A3C60003C045"
BuildableName = "flutter_sunset_alarm.app"
BuildableName = "sunset_alarm.app"
BlueprintName = "Runner"
ReferencedContainer = "container:Runner.xcodeproj">
</BuildableReference>
+1 -1
View File
@@ -5,7 +5,7 @@
// 'flutter create' template.
// The application's name. By default this is also the title of the Flutter window.
PRODUCT_NAME = flutter_sunset_alarm
PRODUCT_NAME = sunset_alarm
// The application's bundle identifier
PRODUCT_BUNDLE_IDENTIFIER = com.example.flutterSunsetAlarm
+2 -2
View File
@@ -23,13 +23,13 @@
<!-- iOS meta tags & icons -->
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<meta name="apple-mobile-web-app-title" content="flutter_sunset_alarm">
<meta name="apple-mobile-web-app-title" content="sunset_alarm">
<link rel="apple-touch-icon" href="icons/Icon-192.png">
<!-- Favicon -->
<link rel="icon" type="image/png" href="favicon.png"/>
<title>flutter_sunset_alarm</title>
<title>sunset_alarm</title>
<link rel="manifest" href="manifest.json">
</head>
<body>
+2 -2
View File
@@ -1,6 +1,6 @@
{
"name": "flutter_sunset_alarm",
"short_name": "flutter_sunset_alarm",
"name": "sunset_alarm",
"short_name": "sunset_alarm",
"start_url": ".",
"display": "standalone",
"background_color": "#0175C2",
+2 -2
View File
@@ -1,10 +1,10 @@
# Project-level configuration.
cmake_minimum_required(VERSION 3.14)
project(flutter_sunset_alarm LANGUAGES CXX)
project(sunset_alarm LANGUAGES CXX)
# The name of the executable created for the application. Change this to change
# the on-disk name of your application.
set(BINARY_NAME "flutter_sunset_alarm")
set(BINARY_NAME "sunset_alarm")
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
# versions of CMake.
+4 -4
View File
@@ -90,12 +90,12 @@ BEGIN
BLOCK "040904e4"
BEGIN
VALUE "CompanyName", "com.example" "\0"
VALUE "FileDescription", "flutter_sunset_alarm" "\0"
VALUE "FileDescription", "sunset_alarm" "\0"
VALUE "FileVersion", VERSION_AS_STRING "\0"
VALUE "InternalName", "flutter_sunset_alarm" "\0"
VALUE "InternalName", "sunset_alarm" "\0"
VALUE "LegalCopyright", "Copyright (C) 2025 com.example. All rights reserved." "\0"
VALUE "OriginalFilename", "flutter_sunset_alarm.exe" "\0"
VALUE "ProductName", "flutter_sunset_alarm" "\0"
VALUE "OriginalFilename", "sunset_alarm.exe" "\0"
VALUE "ProductName", "sunset_alarm" "\0"
VALUE "ProductVersion", VERSION_AS_STRING "\0"
END
END
+1 -1
View File
@@ -27,7 +27,7 @@ int APIENTRY wWinMain(_In_ HINSTANCE instance, _In_opt_ HINSTANCE prev,
FlutterWindow window(project);
Win32Window::Point origin(10, 10);
Win32Window::Size size(1280, 720);
if (!window.Create(L"flutter_sunset_alarm", origin, size)) {
if (!window.Create(L"sunset_alarm", origin, size)) {
return EXIT_FAILURE;
}
window.SetQuitOnClose(true);