feat: Info-Menüpunkt für Version + manuellen Update-Check

Neuer Info-Button im LoginScreen-AppBar öffnet Dialog: installierte
Version, "Jetzt prüfen"-Button ruft checkForNewerVersion() manuell auf
(nicht nur beim App-Start automatisch) und zeigt Ergebnis inline. Findet
er eine neuere Version, erscheint danach auch das normale Update-Banner.
v0.1.7+8.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Dzdm3EWeNdYFUuXFRJryA1
This commit is contained in:
patrickandClaude Sonnet 5 committed 2026-09-10 14:03:06 +02:00
1 parent c5374efbd6
commit 7b0f0fe1fc
3 files changed
+48 -2

No files matched your search

+1 -1
View File
@@ -1,3 +1,3 @@
/// Manuell mit pubspec.yaml synchron halten (siehe timemaster-mobile,
/// gleiche Konvention – kein package_info_plus während aktiver Feldtests).
const String kAppVersion = '0.1.6+7';
const String kAppVersion = '0.1.7+8';
+46
View File
@@ -218,6 +218,51 @@ class _LoginScreenState extends State<LoginScreen> {
}
}
Future<void> _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')),
],
),
),
);
}
void _resetEnrollment() {
showDialog(
context: context,
@@ -250,6 +295,7 @@ class _LoginScreenState extends State<LoginScreen> {
appBar: AppBar(
title: Text('TimeMaster Kiosk · v$kAppVersion'),
actions: [
IconButton(icon: const Icon(Icons.info_outline), onPressed: _showVersionInfo, tooltip: 'Version'),
IconButton(icon: const Icon(Icons.settings), onPressed: _resetEnrollment),
],
),
+1 -1
View File
@@ -1,7 +1,7 @@
name: timemaster_kiosk
description: TimeMaster Kiosk – Stempeluhr für Android-Tablets hinter VPN
publish_to: 'none'
version: 0.1.6+7
version: 0.1.7+8
environment:
sdk: '>=3.3.0 <4.0.0'