feat: more easter eggs + version checking

This commit is contained in:
2026-10-27 00:17:18 +01:00
parent 4d9ba67eb1
commit 1aee0541c4
14 changed files with 178 additions and 6 deletions
+38
View File
@@ -108,6 +108,34 @@ class _BarScreenViewState extends State<BarScreenView> {
);
}
void _showUpdateRequired(String message) {
final l10n = AppLocalizations.of(context);
showDialog<void>(
context: context,
builder: (dialogContext) => AlertDialog(
title: Text(l10n.appUpdateRequired),
content: SelectableText(
message.isEmpty
? l10n.appUpdateRequiredDescription
: '${l10n.appUpdateRequiredDescription}\n\n$message',
),
actions: [
TextButton(
onPressed: () => Navigator.of(dialogContext).pop(),
child: Text(l10n.close),
),
FilledButton(
onPressed: () {
Navigator.of(dialogContext).pop();
context.push('/settings');
},
child: Text(l10n.update),
),
],
),
);
}
void _logout() {
context.read<PinLockViewModel>().lock();
context.read<AdminPinViewModel>().lock();
@@ -167,6 +195,16 @@ class _BarScreenViewState extends State<BarScreenView> {
icon: const Icon(Icons.cloud_off_rounded),
),
],
if (context.watch<RemoteSyncViewModel>().updateRequired
case final message?) ...[
const SizedBox(width: 6),
IconButton(
tooltip: l10n.appUpdateRequired,
color: Theme.of(context).colorScheme.error,
onPressed: () => _showUpdateRequired(message),
icon: const Icon(Icons.system_update_rounded),
),
],
// A failing sync is otherwise invisible: the bar keeps working
// offline while nothing from the website arrives
if (context.watch<RemoteSyncViewModel>().lastError