feat: more easter eggs + version checking
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user