From d6664c582c36f6b53e6cac7a2c0b36eaec0d287c Mon Sep 17 00:00:00 2001 From: patrick Date: Thu, 10 Sep 2026 14:05:19 +0200 Subject: [PATCH] =?UTF-8?q?feat:=20Info-Men=C3=BCpunkt=20f=C3=BCr=20Versio?= =?UTF-8?q?n=20+=20manuellen=20Update-Check?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Analog zur Kiosk-App: Info-Button im HomeScreen-AppBar öffnet Dialog mit installierter Version + "Jetzt prüfen"-Button für manuellen Update-Check. v0.1.10+11. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Dzdm3EWeNdYFUuXFRJryA1 --- lib/app_version.dart | 2 +- lib/screens/home_screen.dart | 46 ++++++++++++++++++++++++++++++++++++ pubspec.yaml | 2 +- 3 files changed, 48 insertions(+), 2 deletions(-) diff --git a/lib/app_version.dart b/lib/app_version.dart index 4708b0a..799fbff 100644 --- a/lib/app_version.dart +++ b/lib/app_version.dart @@ -1,4 +1,4 @@ /// Manuell mit `pubspec.yaml` synchron halten (kein package_info_plus, um /// keine zusätzliche Native-Plugin-Fläche in dieser Debugging-Phase /// einzuführen). Bei jedem Release beide Stellen bumpen. -const String kAppVersion = '0.1.9+10'; +const String kAppVersion = '0.1.10+11'; diff --git a/lib/screens/home_screen.dart b/lib/screens/home_screen.dart index a51030c..44b29e5 100644 --- a/lib/screens/home_screen.dart +++ b/lib/screens/home_screen.dart @@ -42,6 +42,51 @@ class _HomeScreenState extends State { }); } + Future _showVersionInfo() async { + bool checking = false; + String? checkResult; + + await showDialog( + context: context, + builder: (ctx) => StatefulBuilder( + builder: (ctx, setDialogState) => AlertDialog( + title: const Text('Version'), + content: Column( + mainAxisSize: MainAxisSize.min, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('Installiert: v$kAppVersion'), + const SizedBox(height: 12), + if (checking) + const Center(child: Padding(padding: EdgeInsets.all(8), child: CircularProgressIndicator())) + else if (checkResult != null) + Text(checkResult!, style: TextStyle(color: checkResult!.startsWith('Neue') ? Colors.blue : Colors.green[700])), + const SizedBox(height: 8), + TextButton.icon( + onPressed: checking + ? null + : () async { + setDialogState(() => checking = true); + final newer = await _updateService.checkForNewerVersion(); + setDialogState(() { + checking = false; + checkResult = newer != null ? 'Neue Version verfügbar: v$newer' : 'Aktuell – kein Update verfügbar.'; + }); + if (newer != null && mounted) setState(() => _newerVersion = newer); + }, + icon: const Icon(Icons.refresh), + label: const Text('Jetzt prüfen'), + ), + ], + ), + actions: [ + TextButton(onPressed: () => Navigator.pop(ctx), child: const Text('Schließen')), + ], + ), + ), + ); + } + Future _installUpdate() async { setState(() { _updating = true; @@ -199,6 +244,7 @@ class _HomeScreenState extends State { appBar: AppBar( title: const Text('Zeiterfassung · v$kAppVersion'), actions: [ + IconButton(icon: const Icon(Icons.info_outline), onPressed: _showVersionInfo, tooltip: 'Version'), IconButton(icon: const Icon(Icons.logout), onPressed: _logout), ], ), diff --git a/pubspec.yaml b/pubspec.yaml index 6890cc7..ccf6ad3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,7 +1,7 @@ name: timemaster_mobile description: TimeMaster Zeiterfassung – Employee App publish_to: 'none' -version: 0.1.9+10 +version: 0.1.10+11 environment: sdk: '>=3.3.0 <4.0.0'