diff --git a/lib/app_version.dart b/lib/app_version.dart index d55851c..0012509 100644 --- a/lib/app_version.dart +++ b/lib/app_version.dart @@ -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'; diff --git a/lib/screens/login_screen.dart b/lib/screens/login_screen.dart index d0a1e35..646e00b 100644 --- a/lib/screens/login_screen.dart +++ b/lib/screens/login_screen.dart @@ -218,6 +218,51 @@ class _LoginScreenState 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')), + ], + ), + ), + ); + } + void _resetEnrollment() { showDialog( context: context, @@ -250,6 +295,7 @@ class _LoginScreenState extends State { 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), ], ), diff --git a/pubspec.yaml b/pubspec.yaml index 210647b..5d79f64 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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'