implemented a comprehensive client-side demo mode triggered by a "demo@" username prefix, serving curated fixture data for all app modules

This commit is contained in:
2026-07-07 20:24:16 +02:00
parent 2668b111f1
commit 9b74c9fd81
45 changed files with 1409 additions and 43 deletions
+21
View File
@@ -0,0 +1,21 @@
import 'package:flutter/widgets.dart';
import '../api/demo/demo_mode.dart';
import 'info_dialog.dart';
/// Guards an action the demo mode can't back with real data (writes, uploads,
/// downloads, user/element lookups). Shows an info dialog and returns `true`
/// when a demo session is active — callers abort on `true`:
///
/// ```dart
/// if (guardDemoAction(context)) return;
/// ```
bool guardDemoAction(BuildContext context) {
if (!DemoMode.active) return false;
InfoDialog.show(
context,
'Diese Funktion steht im Demo-Modus nicht zur Verfügung.',
title: 'Demo-Modus',
);
return true;
}