debug: clear caches

This commit is contained in:
Thibault Deckers 2020-04-02 11:50:06 +09:00
parent 2a7482d6d4
commit 1b5d2a96d5
2 changed files with 28 additions and 7 deletions

View file

@ -107,7 +107,7 @@ class ThumbnailCollection extends StatelessWidget {
return collection.filters.any((filter) => filter is FavouriteFilter)
? const EmptyContent(
icon: OMIcons.favoriteBorder,
text: 'No favourite!',
text: 'No favourites!',
)
: collection.filters.any((filter) => filter is VideoFilter)
? const EmptyContent(

View file

@ -49,10 +49,7 @@ class DebugPageState extends State<DebugPage> {
children: [
const Text('Settings'),
RaisedButton(
onPressed: () async {
await settings.reset();
setState(() {});
},
onPressed: () => settings.reset().then((_) => setState(() {})),
child: const Text('Reset settings'),
),
Text('collectionGroupFactor: ${settings.collectionGroupFactor}'),
@ -133,8 +130,32 @@ class DebugPageState extends State<DebugPage> {
},
),
const Divider(),
Text('Image cache: ${imageCache.currentSize} items, ${formatFilesize(imageCache.currentSizeBytes)}'),
Text('SVG cache: ${PictureProvider.cacheCount} items'),
Row(
children: [
Text('Image cache: ${imageCache.currentSize} items, ${formatFilesize(imageCache.currentSizeBytes)}'),
const Spacer(),
RaisedButton(
onPressed: () {
imageCache.clear();
setState(() {});
},
child: const Text('Clear'),
),
],
),
Row(
children: [
Text('SVG cache: ${PictureProvider.cacheCount} items'),
const Spacer(),
RaisedButton(
onPressed: () {
PictureProvider.clearCache();
setState(() {});
},
child: const Text('Clear'),
),
],
),
const Divider(),
const Text('Time dilation'),
Slider(