updated project style guidelines

This commit is contained in:
2024-04-03 19:18:17 +02:00
parent 27618f4404
commit 4c7f53e309
185 changed files with 505 additions and 873 deletions

View File

@ -14,8 +14,7 @@ import '../../storage/timetable/timetableSettings.dart';
import '../pages/files/files.dart';
class DefaultSettings {
static Settings get() {
return Settings(
static Settings get() => Settings(
appTheme: ThemeMode.system,
devToolsEnabled: false,
gradeAveragesSettings: GradeAveragesSettings(
@ -53,5 +52,4 @@ class DefaultSettings {
showPerformanceOverlay: false,
),
);
}
}
}

View File

@ -19,8 +19,7 @@ class DevToolsSettingsDialog extends StatefulWidget {
class _DevToolsSettingsDialogState extends State<DevToolsSettingsDialog> {
@override
Widget build(BuildContext context) {
return Column(
Widget build(BuildContext context) => Column(
children: [
ListTile(
leading: const CenteredLeading(Icon(Icons.speed_outlined)),
@ -95,14 +94,10 @@ class _DevToolsSettingsDialogState extends State<DevToolsSettingsDialog> {
title: const Text('Cache-storage JSON dump'),
subtitle: FutureBuilder(
future: const CacheView().totalSize(),
builder: (context, snapshot) {
return Text("etwa ${snapshot.hasError ? "?" : snapshot.hasData ? filesize(snapshot.data) : "..."}\nLange tippen um zu löschen");
},
builder: (context, snapshot) => Text("etwa ${snapshot.hasError ? "?" : snapshot.hasData ? filesize(snapshot.data) : "..."}\nLange tippen um zu löschen"),
),
onTap: () {
Navigator.push(context, MaterialPageRoute(builder: (context) {
return const CacheView();
}));
Navigator.push(context, MaterialPageRoute(builder: (context) => const CacheView()));
},
onLongPress: () {
ConfirmDialog(
@ -116,5 +111,4 @@ class _DevToolsSettingsDialogState extends State<DevToolsSettingsDialog> {
),
],
);
}
}

View File

@ -11,8 +11,7 @@ class PrivacyInfo {
PrivacyInfo({required this.providerText, required this.imprintUrl, required this.privacyUrl});
void showPopup(BuildContext context) {
showDialog(context: context, builder: (context) {
return SimpleDialog(
showDialog(context: context, builder: (context) => SimpleDialog(
title: Text('Betreiberinformation | $providerText'),
children: [
ListTile(
@ -28,7 +27,6 @@ class PrivacyInfo {
onTap: () => ConfirmDialog.openBrowser(context, privacyUrl),
),
],
);
});
));
}
}
}

View File

@ -36,10 +36,7 @@ class _SettingsState extends State<Settings> {
bool developerMode = false;
@override
Widget build(BuildContext context) {
return Consumer<SettingsProvider>(builder: (context, settings, child) {
return Scaffold(
Widget build(BuildContext context) => Consumer<SettingsProvider>(builder: (context, settings, child) => Scaffold(
appBar: AppBar(
title: const Text('Einstellungen'),
),
@ -218,8 +215,7 @@ class _SettingsState extends State<Settings> {
leading: const Icon(Icons.policy_outlined),
title: const Text('Impressum & Datenschutz'),
onTap: () {
showDialog(context: context, builder: (context) {
return SimpleDialog(
showDialog(context: context, builder: (context) => SimpleDialog(
children: [
ListTile(
leading: const CenteredLeading(Icon(Icons.school_outlined)),
@ -243,8 +239,7 @@ class _SettingsState extends State<Settings> {
onTap: () => PrivacyInfo(providerText: 'mhsl', imprintUrl: 'https://mhsl.eu/id.html', privacyUrl: 'https://mhsl.eu/datenschutz.html').showPopup(context),
),
],
);
});
));
},
trailing: const Icon(Icons.arrow_right),
),
@ -297,7 +292,5 @@ class _SettingsState extends State<Settings> {
),
],
),
);
});
}
));
}