Added Nextcloud base

This commit is contained in:
2023-02-20 10:56:51 +01:00
parent e54ae9c2ff
commit fea36b9a6d
63 changed files with 1863 additions and 700 deletions

View File

@ -6,6 +6,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import '../../dataOld/accountModel.dart';
import '../../dataOld/incommingPackets/serverInfoPacket.dart';
import '../../widget/ListItem.dart';
import 'debug/debugOverview.dart';
class Settings extends StatefulWidget {
const Settings({Key? key}) : super(key: key);
@ -19,7 +20,6 @@ class _SettingsState extends State<Settings> {
@override
void initState() {
super.initState();
Provider.of<ServerInfoPacket>(context, listen: false).invoke();
}
@override
@ -31,56 +31,64 @@ class _SettingsState extends State<Settings> {
body: ListView(
children: [
const ListItemNavigator(icon: Icons.info, text: "Über diese App", target: AboutDialog(
applicationIcon: Icon(Icons.send_time_extension_outlined),
applicationLegalese: "Released under MIT-License",
applicationName: "Marianum Fulda",
applicationVersion: "ALPHA 0.1",
)),
ListTile(
leading: const Icon(Icons.logout),
title: const Text("Account abmelden"),
title: const Text("Konto abmelden"),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (builder) => AlertDialog(
title: const Text("Abmelden?"),
content: const Text("Möchtest du dich wirklich abmelden?"),
actions: [
TextButton(
child: const Text("Abmelden"),
onPressed: () {
SharedPreferences.getInstance().then((value) => {
value.clear(),
}).then((value) => {
Provider.of<AccountModel>(context, listen: false).logout(),
Navigator.popUntil(context, (route) => !Navigator.canPop(context)),
});
}
),
showDialog(
context: context,
builder: (context) {
return AlertDialog(
title: const Text("Abmelden?"),
content: const Text("Möchtest du dich wirklich abmelden?"),
actions: [
TextButton(
child: const Text("Abmelden"),
onPressed: () {
SharedPreferences.getInstance().then((value) => {
value.clear(),
}).then((value) => {
Provider.of<AccountModel>(context, listen: false).logout(),
Navigator.popUntil(context, (route) => !Navigator.canPop(context)),
});
}
),
TextButton(
child: const Text("Abbrechen"),
onPressed: () {
Navigator.pop(context);
},
),
],
)));
TextButton(
child: const Text("Abbrechen"),
onPressed: () {
Navigator.pop(context);
},
),
],
);
},
);
},
),
Consumer<ServerInfoPacket>(
builder: (context, serverInfo, child) {
return ListTile(
leading: const Icon(Icons.home_work_outlined),
title: Text("Server: ${serverInfo.serverName}"),
subtitle: Text(
"Betreiber: ${serverInfo.serverOwner}\n"
"Serverversion: ${serverInfo.serverVersion}\n"
"Rechtliche hinweise: ${serverInfo.legal}\n"
),
ListTile(
leading: const Icon(Icons.info),
title: const Text("Informationen und Lizenzen"),
onTap: () {
showAboutDialog(
context: context,
applicationIcon: const Icon(Icons.send_time_extension_outlined),
applicationName: "MarianumMobile",
applicationVersion: "Development Build",
applicationLegalese: "Marianum Fulda 2023 Elias Müller",
);
},
),
ListTile(
leading: const Icon(Icons.bug_report_outlined),
title: const Text("Speicheransicht"),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return const DebugOverview();
}));
},
)
],