Compare commits

..

No commits in common. "master" and "0.9.7" have entirely different histories.

38 changed files with 20 additions and 318 deletions

View File

@ -5,8 +5,7 @@
<application <application
android:label="egg_timer_advanced" android:label="egg_timer_advanced"
android:name="${applicationName}" android:name="${applicationName}"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher">
android:roundIcon="@mipmap/ic_launcher_round">
<activity <activity
android:name=".MainActivity" android:name=".MainActivity"
android:exported="true" android:exported="true"

View File

@ -1,5 +0,0 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
</adaptive-icon>

View File

@ -1,5 +0,0 @@
<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
<background android:drawable="@color/ic_launcher_background" />
<foreground android:drawable="@mipmap/ic_launcher_foreground" />
<monochrome android:drawable="@mipmap/ic_launcher_monochrome" />
</adaptive-icon>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 544 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 442 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 721 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 76 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 32 KiB

View File

@ -1,4 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="ic_launcher_background">#FFFFFF</color>
</resources>

Binary file not shown.

View File

@ -2,12 +2,10 @@ import 'dart:async';
import 'dart:convert'; import 'dart:convert';
import 'dart:math' as math; import 'dart:math' as math;
import 'package:audioplayers/audioplayers.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; // SystemSound import 'package:flutter/services.dart'; // SystemSound
import 'package:geolocator/geolocator.dart'; import 'package:geolocator/geolocator.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;
import 'package:package_info_plus/package_info_plus.dart';
enum EggSize { small, normal, large } enum EggSize { small, normal, large }
enum EggDoneness { soft, medium, hard } enum EggDoneness { soft, medium, hard }
@ -49,19 +47,14 @@ class _EggTimerScreenState extends State<EggTimerScreen> {
Duration _cookTime = const Duration(minutes: 7); Duration _cookTime = const Duration(minutes: 7);
Duration _remainingTime = Duration.zero; Duration _remainingTime = Duration.zero;
Timer? _timer; Timer? _timer;
late final AudioPlayer _audioPlayer;
bool _loadingLocation = false; bool _loadingLocation = false;
String? _error; String? _error;
String? _appVersion;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
_audioPlayer = AudioPlayer();
_configureAudioContext();
_initLocationAndAltitude(); _initLocationAndAltitude();
_loadAppVersion();
} }
Future<void> _initLocationAndAltitude() async { Future<void> _initLocationAndAltitude() async {
@ -173,30 +166,7 @@ class _EggTimerScreenState extends State<EggTimerScreen> {
} }
Future<void> _playAlarm() async { Future<void> _playAlarm() async {
try { await SystemSound.play(SystemSoundType.alert);
await _audioPlayer.stop();
await _audioPlayer.play(AssetSource('alarm.wav'));
} catch (_) {
await SystemSound.play(SystemSoundType.alert);
}
}
Future<void> _configureAudioContext() async {
await AudioPlayer.global.setAudioContext(
AudioContext(
android: const AudioContextAndroid(
isSpeakerphoneOn: true,
stayAwake: false,
contentType: AndroidContentType.sonification,
usageType: AndroidUsageType.alarm,
audioFocus: AndroidAudioFocus.gainTransient,
),
iOS: AudioContextIOS(
category: AVAudioSessionCategory.playback,
options: {AVAudioSessionOptions.defaultToSpeaker},
),
),
);
} }
String _formatDuration(Duration d) { String _formatDuration(Duration d) {
@ -216,24 +186,13 @@ class _EggTimerScreenState extends State<EggTimerScreen> {
@override @override
void dispose() { void dispose() {
_timer?.cancel(); _timer?.cancel();
_audioPlayer.dispose();
super.dispose(); super.dispose();
} }
Future<void> _loadAppVersion() async {
final info = await PackageInfo.fromPlatform();
if (!mounted) return;
setState(() {
_appVersion = info.version;
});
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final altitudeText = final altitudeText =
_altitude != null ? '$_altitude m über NN' : 'unbekannt'; _altitude != null ? '$_altitude m über NN' : 'unbekannt';
final versionLabel =
_appVersion != null ? 'EggTimer Version $_appVersion' : 'EggTimer';
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
@ -461,16 +420,16 @@ class _EggTimerScreenState extends State<EggTimerScreen> {
const SizedBox(height: 16), const SizedBox(height: 16),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: const [
const Icon( Icon(
Icons.smart_toy, Icons.smart_toy,
size: 18, size: 18,
color: Colors.black54, color: Colors.black54,
), ),
const SizedBox(width: 6), SizedBox(width: 6),
Text( Text(
versionLabel, 'Made with AI by ChatGPT',
style: const TextStyle(color: Colors.black54), style: TextStyle(color: Colors.black54),
), ),
], ],
), ),

View File

@ -6,10 +6,6 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <audioplayers_linux/audioplayers_linux_plugin.h>
void fl_register_plugins(FlPluginRegistry* registry) { void fl_register_plugins(FlPluginRegistry* registry) {
g_autoptr(FlPluginRegistrar) audioplayers_linux_registrar =
fl_plugin_registry_get_registrar_for_plugin(registry, "AudioplayersLinuxPlugin");
audioplayers_linux_plugin_register_with_registrar(audioplayers_linux_registrar);
} }

View File

@ -3,7 +3,6 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
audioplayers_linux
) )
list(APPEND FLUTTER_FFI_PLUGIN_LIST list(APPEND FLUTTER_FFI_PLUGIN_LIST

View File

@ -54,29 +54,6 @@ static void my_application_activate(GApplication* application) {
gtk_window_set_default_size(window, 1280, 720); gtk_window_set_default_size(window, 1280, 720);
// Set the window and application icon from the bundled assets.
GError* icon_error = nullptr;
g_autofree gchar* executable_path =
g_file_read_link("/proc/self/exe", &icon_error);
if (icon_error != nullptr) {
g_warning("Failed to read executable path: %s", icon_error->message);
g_clear_error(&icon_error);
}
if (executable_path != nullptr) {
g_autofree gchar* executable_dir = g_path_get_dirname(executable_path);
g_autofree gchar* icon_path = g_build_filename(
executable_dir, "data", "flutter_assets", "assets", "app_icon.png",
nullptr);
gtk_window_set_icon_from_file(window, icon_path, &icon_error);
if (icon_error != nullptr) {
g_warning("Failed to load window icon: %s", icon_error->message);
g_clear_error(&icon_error);
} else {
gtk_window_set_default_icon_from_file(icon_path, nullptr);
}
}
g_autoptr(FlDartProject) project = fl_dart_project_new(); g_autoptr(FlDartProject) project = fl_dart_project_new();
fl_dart_project_set_dart_entrypoint_arguments( fl_dart_project_set_dart_entrypoint_arguments(
project, self->dart_entrypoint_arguments); project, self->dart_entrypoint_arguments);

View File

@ -5,14 +5,8 @@
import FlutterMacOS import FlutterMacOS
import Foundation import Foundation
import audioplayers_darwin
import geolocator_apple import geolocator_apple
import package_info_plus
import path_provider_foundation
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
AudioplayersDarwinPlugin.register(with: registry.registrar(forPlugin: "AudioplayersDarwinPlugin"))
GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin")) GeolocatorPlugin.register(with: registry.registrar(forPlugin: "GeolocatorPlugin"))
FPPPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FPPPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
} }

View File

@ -9,62 +9,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "2.13.0" version: "2.13.0"
audioplayers:
dependency: "direct main"
description:
name: audioplayers
sha256: "5441fa0ceb8807a5ad701199806510e56afde2b4913d9d17c2f19f2902cf0ae4"
url: "https://pub.dev"
source: hosted
version: "6.5.1"
audioplayers_android:
dependency: transitive
description:
name: audioplayers_android
sha256: "60a6728277228413a85755bd3ffd6fab98f6555608923813ce383b190a360605"
url: "https://pub.dev"
source: hosted
version: "5.2.1"
audioplayers_darwin:
dependency: transitive
description:
name: audioplayers_darwin
sha256: "0811d6924904ca13f9ef90d19081e4a87f7297ddc19fc3d31f60af1aaafee333"
url: "https://pub.dev"
source: hosted
version: "6.3.0"
audioplayers_linux:
dependency: transitive
description:
name: audioplayers_linux
sha256: f75bce1ce864170ef5e6a2c6a61cd3339e1a17ce11e99a25bae4474ea491d001
url: "https://pub.dev"
source: hosted
version: "4.2.1"
audioplayers_platform_interface:
dependency: transitive
description:
name: audioplayers_platform_interface
sha256: "0e2f6a919ab56d0fec272e801abc07b26ae7f31980f912f24af4748763e5a656"
url: "https://pub.dev"
source: hosted
version: "7.1.1"
audioplayers_web:
dependency: transitive
description:
name: audioplayers_web
sha256: "1c0f17cec68455556775f1e50ca85c40c05c714a99c5eb1d2d57cc17ba5522d7"
url: "https://pub.dev"
source: hosted
version: "5.1.1"
audioplayers_windows:
dependency: transitive
description:
name: audioplayers_windows
sha256: "4048797865105b26d47628e6abb49231ea5de84884160229251f37dfcbe52fd7"
url: "https://pub.dev"
source: hosted
version: "4.2.1"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@ -121,22 +65,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.3.3" version: "1.3.3"
ffi:
dependency: transitive
description:
name: ffi
sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
file:
dependency: transitive
description:
name: file
sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4
url: "https://pub.dev"
source: hosted
version: "7.0.1"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:
@ -288,22 +216,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.17.0" version: "1.17.0"
package_info_plus:
dependency: "direct main"
description:
name: package_info_plus
sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968"
url: "https://pub.dev"
source: hosted
version: "8.3.1"
package_info_plus_platform_interface:
dependency: transitive
description:
name: package_info_plus_platform_interface
sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086"
url: "https://pub.dev"
source: hosted
version: "3.2.1"
path: path:
dependency: transitive dependency: transitive
description: description:
@ -312,62 +224,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.9.1" version: "1.9.1"
path_provider:
dependency: transitive
description:
name: path_provider
sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd"
url: "https://pub.dev"
source: hosted
version: "2.1.5"
path_provider_android:
dependency: transitive
description:
name: path_provider_android
sha256: f2c65e21139ce2c3dad46922be8272bb5963516045659e71bb16e151c93b580e
url: "https://pub.dev"
source: hosted
version: "2.2.22"
path_provider_foundation:
dependency: transitive
description:
name: path_provider_foundation
sha256: "97390a0719146c7c3e71b6866c34f1cde92685933165c1c671984390d2aca776"
url: "https://pub.dev"
source: hosted
version: "2.4.4"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279
url: "https://pub.dev"
source: hosted
version: "2.2.1"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334"
url: "https://pub.dev"
source: hosted
version: "2.1.2"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7
url: "https://pub.dev"
source: hosted
version: "2.3.0"
platform:
dependency: transitive
description:
name: platform
sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984"
url: "https://pub.dev"
source: hosted
version: "3.1.6"
plugin_platform_interface: plugin_platform_interface:
dependency: transitive dependency: transitive
description: description:
@ -413,14 +269,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.4.1" version: "1.4.1"
synchronized:
dependency: transitive
description:
name: synchronized
sha256: c254ade258ec8282947a0acbbc90b9575b4f19673533ee46f2f6e9b3aeefd7c0
url: "https://pub.dev"
source: hosted
version: "3.4.0"
term_glyph: term_glyph:
dependency: transitive dependency: transitive
description: description:
@ -477,22 +325,6 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.1.1" version: "1.1.1"
win32:
dependency: transitive
description:
name: win32
sha256: d7cb55e04cd34096cd3a79b3330245f54cb96a370a1c27adb3c84b917de8b08e
url: "https://pub.dev"
source: hosted
version: "5.15.0"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15"
url: "https://pub.dev"
source: hosted
version: "1.1.0"
sdks: sdks:
dart: ">=3.10.1 <4.0.0" dart: ">=3.10.1 <4.0.0"
flutter: ">=3.35.0" flutter: ">=3.18.0-18.0.pre.54"

View File

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts # In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix. # of the product and file versions while build-number is used as the build suffix.
version: 0.9.15 version: 0.9.7
environment: environment:
sdk: ^3.10.1 sdk: ^3.10.1
@ -37,8 +37,6 @@ dependencies:
http: ^1.2.0 # Webservice für Höhe http: ^1.2.0 # Webservice für Höhe
geolocator: ^13.0.0 # Standortbestimmung geolocator: ^13.0.0 # Standortbestimmung
package_info_plus: ^8.0.0
audioplayers: ^6.1.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
@ -65,7 +63,6 @@ flutter:
assets: assets:
- assets/egg_background.png - assets/egg_background.png
- assets/app_icon.png - assets/app_icon.png
- assets/alarm.wav
# To add assets to your application, add an assets section, like this: # To add assets to your application, add an assets section, like this:
# assets: # assets:
# - images/a_dot_burr.jpeg # - images/a_dot_burr.jpeg

View File

@ -1,5 +1,15 @@
#!/bin/bash #!/bin/bash
set -euo pipefail set -euo pipefail
flutter clean
flutter pub get
flutter build apk --release
cp build/app/outputs/flutter-apk/app-release.apk ./release/eggtimer.apk
echo "APK built and copied to ./release/eggtimer.apk"
GITEA_URL="https://git.ude-consult.de"
GITEA_TOKEN="6ea286299e8e081d9923d5deea2fbd91ad83dc8e"
OWNER="Arnold"
REPO="EggTimer"
APK_PATH="release/eggtimer.apk"
PUBSPEC="pubspec.yaml" PUBSPEC="pubspec.yaml"
@ -19,18 +29,6 @@ echo "Neue Version: $new"
sed -i "s/^version: .*/version: ${new}/" "$PUBSPEC" sed -i "s/^version: .*/version: ${new}/" "$PUBSPEC"
flutter clean
flutter pub get
flutter build apk --release
mkdir -p release
cp build/app/outputs/flutter-apk/app-release.apk ./release/eggtimer.apk
echo "APK built and copied to ./release/eggtimer.apk"
GITEA_URL="https://git.ude-consult.de"
GITEA_TOKEN="6ea286299e8e081d9923d5deea2fbd91ad83dc8e"
OWNER="Arnold"
REPO="EggTimer"
APK_PATH="release/eggtimer.apk"
# Version z.B. aus Datei oder Argument # Version z.B. aus Datei oder Argument
VERSION_TAG=$(grep "^version:" pubspec.yaml | awk '{print $2}') VERSION_TAG=$(grep "^version:" pubspec.yaml | awk '{print $2}')
git commit -a -m"Version auf ${VERSION_TAG} gesetzt" git commit -a -m"Version auf ${VERSION_TAG} gesetzt"
@ -63,38 +61,12 @@ fi
echo "Release ${VERSION_TAG} erstellt, ID=${release_id}" echo "Release ${VERSION_TAG} erstellt, ID=${release_id}"
APK_FILENAME="eggtimer-${VERSION_TAG}.apk"
# Alte Assets entfernen, damit nur die APK im Release bleibt
existing_assets=$(curl -sS \
-H "Authorization: token ${GITEA_TOKEN}" \
"${GITEA_URL}/api/v1/repos/${OWNER}/${REPO}/releases/${release_id}/assets")
echo "$existing_assets" | jq -r '.[] | [.id, .name] | @tsv' | while IFS=$'\t' read -r asset_id asset_name; do
echo "Entferne altes Asset: ${asset_name}"
curl -sS -X DELETE \
-H "Authorization: token ${GITEA_TOKEN}" \
"${GITEA_URL}/api/v1/repos/${OWNER}/${REPO}/releases/${release_id}/assets/${asset_id}" >/dev/null
done
# 2. APK hochladen # 2. APK hochladen
curl -sS -X POST \ curl -sS -X POST \
-H "Authorization: token ${GITEA_TOKEN}" \ -H "Authorization: token ${GITEA_TOKEN}" \
-F "attachment=@${APK_PATH};filename=${APK_FILENAME}" \ -F "attachment=@${APK_PATH};filename=eggtimer-${VERSION_TAG}.apk" \
"${GITEA_URL}/api/v1/repos/${OWNER}/${REPO}/releases/${release_id}/assets" "${GITEA_URL}/api/v1/repos/${OWNER}/${REPO}/releases/${release_id}/assets"
echo "APK hochgeladen." echo "APK hochgeladen."
# Nur die drei neuesten Releases behalten, ältere löschen
all_releases=$(curl -sS \
-H "Authorization: token ${GITEA_TOKEN}" \
"${GITEA_URL}/api/v1/repos/${OWNER}/${REPO}/releases")
echo "$all_releases" | jq -r 'sort_by(.created_at) | .[0:-3] | .[]? | "\(.id)\t\(.tag_name)"' | while IFS=$'\t' read -r old_id old_tag; do
echo "Lösche altes Release: ${old_tag} (ID ${old_id})"
curl -sS -X DELETE \
-H "Authorization: token ${GITEA_TOKEN}" \
"${GITEA_URL}/api/v1/repos/${OWNER}/${REPO}/releases/${old_id}" >/dev/null
done
echo "Ältere Releases bereinigt; es bleiben die letzten drei."

Binary file not shown.

View File

@ -1,5 +0,0 @@
# Test the release before publishing
flutter emulator --launch Pixel_7
sleep 5s
flutter run

View File

@ -6,12 +6,9 @@
#include "generated_plugin_registrant.h" #include "generated_plugin_registrant.h"
#include <audioplayers_windows/audioplayers_windows_plugin.h>
#include <geolocator_windows/geolocator_windows.h> #include <geolocator_windows/geolocator_windows.h>
void RegisterPlugins(flutter::PluginRegistry* registry) { void RegisterPlugins(flutter::PluginRegistry* registry) {
AudioplayersWindowsPluginRegisterWithRegistrar(
registry->GetRegistrarForPlugin("AudioplayersWindowsPlugin"));
GeolocatorWindowsRegisterWithRegistrar( GeolocatorWindowsRegisterWithRegistrar(
registry->GetRegistrarForPlugin("GeolocatorWindows")); registry->GetRegistrarForPlugin("GeolocatorWindows"));
} }

View File

@ -3,7 +3,6 @@
# #
list(APPEND FLUTTER_PLUGIN_LIST list(APPEND FLUTTER_PLUGIN_LIST
audioplayers_windows
geolocator_windows geolocator_windows
) )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 364 KiB

After

Width:  |  Height:  |  Size: 33 KiB