restructured settings and devtools
This commit is contained in:
@ -3,7 +3,6 @@ import 'dart:async';
|
||||
import 'dart:convert';
|
||||
import 'package:filesize/filesize.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/services.dart';
|
||||
import 'package:jiffy/jiffy.dart';
|
||||
import 'package:localstore/localstore.dart';
|
||||
|
||||
@ -41,7 +40,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
@override
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Lokaler cache'),
|
||||
title: const Text('Cache storage'),
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: files,
|
||||
@ -58,27 +57,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
title: Text(filename),
|
||||
subtitle: Text("${filesize(jsonEncode(element).length * 8)}, ${Jiffy.parseFromMillisecondsSinceEpoch(element['lastupdate']).fromNow()}"),
|
||||
trailing: const Icon(Icons.arrow_right),
|
||||
onTap: () {
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => JsonViewer(title: filename, data: jsonDecode(element['json'])),));
|
||||
},
|
||||
onLongPress: () {
|
||||
showDialog(context: context, builder: (context) => SimpleDialog(
|
||||
children: [
|
||||
const ListTile(
|
||||
leading: Icon(Icons.delete_forever),
|
||||
title: Text('Diese Datei löschen'),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.copy),
|
||||
title: const Text('Dateitext kopieren'),
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: jsonEncode(element)));
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
)
|
||||
],
|
||||
));
|
||||
},
|
||||
onTap: () => JsonViewer.asDialog(context, jsonDecode(element['json'])),
|
||||
);
|
||||
},
|
||||
);
|
||||
|
Reference in New Issue
Block a user