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:animated_digit/animated_digit.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class AnimatedTime extends StatefulWidget {
|
class AnimatedTime extends StatefulWidget {
|
||||||
final Duration Function() callback;
|
final Duration Function() callback;
|
||||||
@ -40,7 +41,6 @@ class _AnimatedTimeState extends State<AnimatedTime> {
|
|||||||
buildWidget(current.inMinutes > 60 ? current.inMinutes - current.inHours * 60 : current.inMinutes),
|
buildWidget(current.inMinutes > 60 ? current.inMinutes - current.inHours * 60 : current.inMinutes),
|
||||||
const Text(":"),
|
const Text(":"),
|
||||||
buildWidget(current.inSeconds > 60 ? current.inSeconds - current.inMinutes * 60 : current.inSeconds),
|
buildWidget(current.inSeconds > 60 ? current.inSeconds - current.inMinutes * 60 : current.inSeconds),
|
||||||
const Text(""),
|
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -49,7 +49,10 @@ class _AnimatedTimeState extends State<AnimatedTime> {
|
|||||||
return AnimatedDigitWidget(
|
return AnimatedDigitWidget(
|
||||||
value: value,
|
value: value,
|
||||||
duration: const Duration(milliseconds: 100),
|
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)}"),
|
title: Text("bis zum ${parseString(holiday.end)}"),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.timer_outlined),
|
leading: const CenteredLeading(Icon(Icons.timer_outlined)),
|
||||||
title: AnimatedTime(callback: () => DateTime.parse(holiday.start).difference(DateTime.now())),
|
title: AnimatedTime(callback: () => DateTime.parse(holiday.start).difference(DateTime.now())),
|
||||||
subtitle: Text(Jiffy.parse(holiday.start).fromNow()),
|
subtitle: Text(Jiffy.parse(holiday.start).fromNow()),
|
||||||
),
|
),
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
|
|
||||||
import 'package:filesize/filesize.dart';
|
import 'package:filesize/filesize.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:marianum_mobile/widget/centeredLeading.dart';
|
||||||
import 'package:package_info/package_info.dart';
|
import 'package:package_info/package_info.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';
|
||||||
@ -220,32 +221,9 @@ class _SettingsState extends State<Settings> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.data_object),
|
leading: const CenteredLeading(Icon(Icons.image_outlined)),
|
||||||
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),
|
|
||||||
title: const Text("Cached Thumbnails löschen"),
|
title: const Text("Cached Thumbnails löschen"),
|
||||||
|
subtitle: Text("etwa ${filesize(PaintingBinding.instance.imageCache.currentSizeBytes)}"),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
ConfirmDialog(
|
ConfirmDialog(
|
||||||
title: "Thumbs cache löschen",
|
title: "Thumbs cache löschen",
|
||||||
@ -254,18 +232,19 @@ class _SettingsState extends State<Settings> {
|
|||||||
onConfirm: () => PaintingBinding.instance.imageCache.clear(),
|
onConfirm: () => PaintingBinding.instance.imageCache.clear(),
|
||||||
).asDialog(context);
|
).asDialog(context);
|
||||||
},
|
},
|
||||||
|
trailing: const Icon(Icons.arrow_right),
|
||||||
),
|
),
|
||||||
ListTile(
|
ListTile(
|
||||||
leading: const Icon(Icons.settings_applications_outlined),
|
leading: const CenteredLeading(Icon(Icons.settings_applications_outlined)),
|
||||||
title: const Text("Storage JSON dump"),
|
title: const Text("Settings-storage JSON dump"),
|
||||||
subtitle: const Text("Tippen und halten um zu löschen"),
|
subtitle: Text("etwa ${filesize(settings.val().toJson().toString().length * 8)}\nLange tippen um zu löschen"),
|
||||||
onTap: () {
|
onTap: () {
|
||||||
JsonViewer.asDialog(context, settings.val().toJson());
|
JsonViewer.asDialog(context, settings.val().toJson());
|
||||||
},
|
},
|
||||||
onLongPress: () {
|
onLongPress: () {
|
||||||
ConfirmDialog(
|
ConfirmDialog(
|
||||||
title: "App-Speicher löschen",
|
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",
|
confirmButton: "Unwiederruflich Löschen",
|
||||||
onConfirm: () {
|
onConfirm: () {
|
||||||
setState(() {
|
setState(() {
|
||||||
@ -274,6 +253,31 @@ class _SettingsState extends State<Settings> {
|
|||||||
},
|
},
|
||||||
).asDialog(context);
|
).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