diff --git a/lib/screen/settings/settings.dart b/lib/screen/settings/settings.dart index 6a48c4a..3ec0b7f 100644 --- a/lib/screen/settings/settings.dart +++ b/lib/screen/settings/settings.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:shared_preferences/shared_preferences.dart'; +import 'package:url_launcher/url_launcher.dart'; import '../../data/accountModel.dart'; import 'debug/debugOverview.dart'; @@ -20,8 +21,11 @@ class _SettingsState extends State { super.initState(); } + bool developerMode = false; + @override Widget build(BuildContext context) { + return Scaffold( appBar: AppBar( title: const Text("Einstellungen"), @@ -65,6 +69,8 @@ class _SettingsState extends State { }, ), + const Divider(), + ListTile( leading: const Icon(Icons.info), title: const Text("Informationen und Lizenzen"), @@ -77,18 +83,70 @@ class _SettingsState extends State { applicationLegalese: "Marianum Fulda 2023 Elias Müller", ); }, + trailing: const Icon(Icons.arrow_right), ), ListTile( - leading: const Icon(Icons.bug_report_outlined), - title: const Text("Speicheransicht"), + leading: const Icon(Icons.privacy_tip), + title: const Text("Datenschutz"), onTap: () { - Navigator.push(context, MaterialPageRoute(builder: (context) { - return const DebugOverview(); - })); + launchUrl(Uri.parse("https://mhsl.eu/datenschutz.html")); }, - ) + trailing: const Icon(Icons.open_in_new), + ), + ListTile( + leading: const Icon(Icons.person_pin_rounded), + title: const Text("Impressum"), + onTap: () { + launchUrl(Uri.parse("https://mhsl.eu/id.html")); + }, + trailing: const Icon(Icons.open_in_new), + ), + + const Divider(), + + ListTile( + leading: const Icon(Icons.developer_mode), + title: const Text("Entwicklermodus"), + trailing: Checkbox( + value: developerMode, + onChanged: (state) { + setState(() { + developerMode = !developerMode; + }); + }, + ), + ), + + Visibility( + visible: developerMode, + child: ListTile( + leading: const Icon(Icons.data_object), + title: const Text("Storage view"), + onTap: () { + Navigator.push(context, MaterialPageRoute(builder: (context) { + return const DebugOverview(); + })); + }, + trailing: const Icon(Icons.arrow_right), + ), + ), + + Visibility( + visible: developerMode && false, // TODO Implement verbose logging + child: ListTile( + leading: const Icon(Icons.logo_dev), + title: const Text("Logging verbosity"), + trailing: DropdownButton( + value: "1", + items: ["1", "2", "3"].map((e) => DropdownMenuItem(value: e, child: Text(e))).toList(), + onChanged: (e) { + + }, + ), + ), + ), ], ), );