updated project style guidelines
This commit is contained in:
@ -39,8 +39,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
Widget build(BuildContext context) => Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('Lokaler cache'),
|
||||
),
|
||||
@ -52,7 +51,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
itemCount: snapshot.data!.length,
|
||||
itemBuilder: (context, index) {
|
||||
Map<String, dynamic> element = snapshot.data![snapshot.data!.keys.elementAt(index)];
|
||||
String filename = snapshot.data!.keys.elementAt(index).split('/').last;
|
||||
var filename = snapshot.data!.keys.elementAt(index).split('/').last;
|
||||
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.text_snippet_outlined),
|
||||
@ -60,13 +59,10 @@ class _CacheViewState extends State<CacheView> {
|
||||
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) {
|
||||
return JsonViewer(title: filename, data: jsonDecode(element['json']));
|
||||
},));
|
||||
Navigator.push(context, MaterialPageRoute(builder: (context) => JsonViewer(title: filename, data: jsonDecode(element['json'])),));
|
||||
},
|
||||
onLongPress: () {
|
||||
showDialog(context: context, builder: (context) {
|
||||
return SimpleDialog(
|
||||
showDialog(context: context, builder: (context) => SimpleDialog(
|
||||
children: [
|
||||
const ListTile(
|
||||
leading: Icon(Icons.delete_forever),
|
||||
@ -81,8 +77,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
},
|
||||
)
|
||||
],
|
||||
);
|
||||
});
|
||||
));
|
||||
},
|
||||
);
|
||||
},
|
||||
@ -99,7 +94,6 @@ class _CacheViewState extends State<CacheView> {
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
extension FutureExtension<T> on Future<T> {
|
||||
|
Reference in New Issue
Block a user