Changed Settings layout and added Option for developer mode
This commit is contained in:
parent
1f9d6ca6bf
commit
d1ec0c5898
@ -2,6 +2,7 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:shared_preferences/shared_preferences.dart';
|
import 'package:shared_preferences/shared_preferences.dart';
|
||||||
|
import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import '../../data/accountModel.dart';
|
import '../../data/accountModel.dart';
|
||||||
import 'debug/debugOverview.dart';
|
import 'debug/debugOverview.dart';
|
||||||
@ -20,8 +21,11 @@ class _SettingsState extends State<Settings> {
|
|||||||
super.initState();
|
super.initState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool developerMode = false;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
appBar: AppBar(
|
appBar: AppBar(
|
||||||
title: const Text("Einstellungen"),
|
title: const Text("Einstellungen"),
|
||||||
@ -65,6 +69,8 @@ class _SettingsState extends State<Settings> {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
||||||
|
const Divider(),
|
||||||
|
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.info),
|
leading: const Icon(Icons.info),
|
||||||
title: const Text("Informationen und Lizenzen"),
|
title: const Text("Informationen und Lizenzen"),
|
||||||
@ -77,18 +83,70 @@ class _SettingsState extends State<Settings> {
|
|||||||
applicationLegalese: "Marianum Fulda 2023 Elias Müller",
|
applicationLegalese: "Marianum Fulda 2023 Elias Müller",
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
trailing: const Icon(Icons.arrow_right),
|
||||||
),
|
),
|
||||||
|
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.bug_report_outlined),
|
leading: const Icon(Icons.privacy_tip),
|
||||||
title: const Text("Speicheransicht"),
|
title: const Text("Datenschutz"),
|
||||||
|
onTap: () {
|
||||||
|
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: () {
|
onTap: () {
|
||||||
Navigator.push(context, MaterialPageRoute(builder: (context) {
|
Navigator.push(context, MaterialPageRoute(builder: (context) {
|
||||||
return const DebugOverview();
|
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<String>(
|
||||||
|
value: "1",
|
||||||
|
items: ["1", "2", "3"].map((e) => DropdownMenuItem<String>(value: e, child: Text(e))).toList(),
|
||||||
|
onChanged: (e) {
|
||||||
|
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user