Fixed some visuals and inconsistencies
This commit is contained in:
parent
12bde4ab43
commit
222321de4e
@ -2,6 +2,7 @@ import 'dart:async';
|
||||
|
||||
import 'package:animated_digit/animated_digit.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class AnimatedTime extends StatefulWidget {
|
||||
final Duration Function() callback;
|
||||
@ -40,7 +41,6 @@ class _AnimatedTimeState extends State<AnimatedTime> {
|
||||
buildWidget(current.inMinutes > 60 ? current.inMinutes - current.inHours * 60 : current.inMinutes),
|
||||
const Text(":"),
|
||||
buildWidget(current.inSeconds > 60 ? current.inSeconds - current.inMinutes * 60 : current.inSeconds),
|
||||
const Text(""),
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -49,7 +49,10 @@ class _AnimatedTimeState extends State<AnimatedTime> {
|
||||
return AnimatedDigitWidget(
|
||||
value: value,
|
||||
duration: const Duration(milliseconds: 100),
|
||||
textStyle: const TextStyle(fontSize: 15),
|
||||
textStyle: TextStyle(
|
||||
fontSize: 15,
|
||||
color: Theme.of(context).colorScheme.onSurface,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ class _HolidaysState extends State<Holidays> {
|
||||
title: Text("bis zum ${parseString(holiday.end)}"),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.timer_outlined),
|
||||
leading: const CenteredLeading(Icon(Icons.timer_outlined)),
|
||||
title: AnimatedTime(callback: () => DateTime.parse(holiday.start).difference(DateTime.now())),
|
||||
subtitle: Text(Jiffy.parse(holiday.start).fromNow()),
|
||||
),
|
||||
|
@ -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),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
Loading…
x
Reference in New Issue
Block a user