Fixed some visuals and inconsistencies
This commit is contained in:
@ -1,6 +1,7 @@
|
||||
|
||||
import 'package:filesize/filesize.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:marianum_mobile/widget/centeredLeading.dart';
|
||||
import 'package:package_info/package_info.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
@ -220,32 +221,9 @@ class _SettingsState extends State<Settings> {
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.data_object),
|
||||
title: FutureBuilder(
|
||||
future: const CacheView().totalSize(),
|
||||
builder: (context, snapshot) {
|
||||
return Text("Cache JSON dump (${snapshot.hasError ? "?" : snapshot.hasData ? "est. ${filesize(snapshot.data)}" : "Berechnen..."})");
|
||||
},
|
||||
),
|
||||
subtitle: const Text("Tippen und halten um zu löschen"),
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) {
|
||||
return const CacheView();
|
||||
}));
|
||||
},
|
||||
onLongPress: () {
|
||||
ConfirmDialog(
|
||||
title: "Cache löschen",
|
||||
content: "Alle cache Einträge werden gelöscht. Der cache wird bei benutzung der App erneut aufgebaut",
|
||||
confirmButton: "Unwiederruflich löschen",
|
||||
onConfirm: () => const CacheView().clear().then((value) => setState((){})),
|
||||
).asDialog(context);
|
||||
},
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.broken_image),
|
||||
leading: const CenteredLeading(Icon(Icons.image_outlined)),
|
||||
title: const Text("Cached Thumbnails löschen"),
|
||||
subtitle: Text("etwa ${filesize(PaintingBinding.instance.imageCache.currentSizeBytes)}"),
|
||||
onTap: () {
|
||||
ConfirmDialog(
|
||||
title: "Thumbs cache löschen",
|
||||
@ -254,18 +232,19 @@ class _SettingsState extends State<Settings> {
|
||||
onConfirm: () => PaintingBinding.instance.imageCache.clear(),
|
||||
).asDialog(context);
|
||||
},
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.settings_applications_outlined),
|
||||
title: const Text("Storage JSON dump"),
|
||||
subtitle: const Text("Tippen und halten um zu löschen"),
|
||||
leading: const CenteredLeading(Icon(Icons.settings_applications_outlined)),
|
||||
title: const Text("Settings-storage JSON dump"),
|
||||
subtitle: Text("etwa ${filesize(settings.val().toJson().toString().length * 8)}\nLange tippen um zu löschen"),
|
||||
onTap: () {
|
||||
JsonViewer.asDialog(context, settings.val().toJson());
|
||||
},
|
||||
onLongPress: () {
|
||||
ConfirmDialog(
|
||||
title: "App-Speicher löschen",
|
||||
content: "Alle Einstellungen und gespeicherten Inhalte gehen verloren! Accountdaten sind nicht betroffen.",
|
||||
content: "Alle Einstellungen gehen verloren! Accountdaten sowie App-Daten sind nicht betroffen.",
|
||||
confirmButton: "Unwiederruflich Löschen",
|
||||
onConfirm: () {
|
||||
setState(() {
|
||||
@ -274,6 +253,31 @@ class _SettingsState extends State<Settings> {
|
||||
},
|
||||
).asDialog(context);
|
||||
},
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
),
|
||||
ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.data_object)),
|
||||
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");
|
||||
},
|
||||
),
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) {
|
||||
return const CacheView();
|
||||
}));
|
||||
},
|
||||
onLongPress: () {
|
||||
ConfirmDialog(
|
||||
title: "App-Cache löschen",
|
||||
content: "Alle cache Einträge werden gelöscht. Der Cache wird bei Nutzung der App automatisch erneut aufgebaut",
|
||||
confirmButton: "Unwiederruflich löschen",
|
||||
onConfirm: () => const CacheView().clear().then((value) => setState((){})),
|
||||
).asDialog(context);
|
||||
},
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
Reference in New Issue
Block a user