feat: Info-Menüpunkt für Version + manuellen Update-Check
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 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Dzdm3EWeNdYFUuXFRJryA1
This commit is contained in:
1 parent
e9c455bd6e
commit
d6664c582c
3 files changed
+48
-2
No files matched your search
@@ -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';
|
||||
@@ -42,6 +42,51 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
});
|
||||
}
|
||||
|
||||
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')),
|
||||
],
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _installUpdate() async {
|
||||
setState(() {
|
||||
_updating = true;
|
||||
@@ -199,6 +244,7 @@ class _HomeScreenState extends State<HomeScreen> {
|
||||
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),
|
||||
],
|
||||
),
|
||||
|
||||
+1
-1
@@ -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'
|
||||
|
||||
Reference in new issue
Block a user