updated project linter-rules and enforced them
This commit is contained in:
@ -11,7 +11,7 @@ import '../../../widget/placeholderView.dart';
|
||||
import 'jsonViewer.dart';
|
||||
|
||||
class CacheView extends StatefulWidget {
|
||||
final collection = "MarianumMobile";
|
||||
final collection = 'MarianumMobile';
|
||||
const CacheView({super.key});
|
||||
|
||||
@override
|
||||
@ -42,7 +42,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text("Lokaler cache"),
|
||||
title: const Text('Lokaler cache'),
|
||||
),
|
||||
body: FutureBuilder(
|
||||
future: files,
|
||||
@ -52,7 +52,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;
|
||||
String filename = snapshot.data!.keys.elementAt(index).split('/').last;
|
||||
|
||||
return ListTile(
|
||||
leading: const Icon(Icons.text_snippet_outlined),
|
||||
@ -70,11 +70,11 @@ class _CacheViewState extends State<CacheView> {
|
||||
children: [
|
||||
const ListTile(
|
||||
leading: Icon(Icons.delete_forever),
|
||||
title: Text("Diese Datei löschen"),
|
||||
title: Text('Diese Datei löschen'),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.copy),
|
||||
title: const Text("Dateitext kopieren"),
|
||||
title: const Text('Dateitext kopieren'),
|
||||
onTap: () {
|
||||
Clipboard.setData(ClipboardData(text: jsonEncode(element)));
|
||||
Navigator.of(context).pop();
|
||||
@ -93,7 +93,7 @@ class _CacheViewState extends State<CacheView> {
|
||||
);
|
||||
} else {
|
||||
return const Center(
|
||||
child: PlaceholderView(icon: Icons.hourglass_empty, text: "Keine Daten"),
|
||||
child: PlaceholderView(icon: Icons.hourglass_empty, text: 'Keine Daten'),
|
||||
);
|
||||
}
|
||||
},
|
||||
|
@ -15,17 +15,17 @@ class DebugTile {
|
||||
|
||||
Widget jsonData(Map<String, dynamic> data, {bool ignoreConfig = false}) {
|
||||
return callback(
|
||||
title: "JSON daten anzeigen",
|
||||
title: 'JSON daten anzeigen',
|
||||
onTab: () => JsonViewer.asDialog(context, data)
|
||||
);
|
||||
}
|
||||
|
||||
Widget callback({String title = "Debugaktion", required void Function() onTab}) {
|
||||
Widget callback({String title = 'Debugaktion', required void Function() onTab}) {
|
||||
return child(
|
||||
ListTile(
|
||||
leading: const CenteredLeading(Icon(Icons.developer_mode_outlined)),
|
||||
title: Text(title),
|
||||
subtitle: const Text("Entwicklermodus aktiviert"),
|
||||
subtitle: const Text('Entwicklermodus aktiviert'),
|
||||
onTap: onTab,
|
||||
)
|
||||
);
|
||||
|
@ -30,20 +30,20 @@ class JsonViewer extends StatelessWidget {
|
||||
showDialog(context: context, builder: (context) {
|
||||
return AlertDialog(
|
||||
scrollable: true,
|
||||
title: const Row(children: [Icon(Icons.bug_report_outlined), Text("Rohdaten")]),
|
||||
title: const Row(children: [Icon(Icons.bug_report_outlined), Text('Rohdaten')]),
|
||||
content: Text(JsonViewer.format(dataMap)),
|
||||
actions: [
|
||||
TextButton(onPressed: () {
|
||||
Clipboard.setData(ClipboardData(text: JsonViewer.format(dataMap))).then((value) {
|
||||
showDialog(context: context, builder: (context) => const AlertDialog(content: Text("Formatiertes JSON wurde erfolgreich in deiner Zwischenlage abgelegt.")));
|
||||
showDialog(context: context, builder: (context) => const AlertDialog(content: Text('Formatiertes JSON wurde erfolgreich in deiner Zwischenlage abgelegt.')));
|
||||
});
|
||||
}, child: const Text("Kopieren")),
|
||||
}, child: const Text('Kopieren')),
|
||||
TextButton(onPressed: () {
|
||||
Clipboard.setData(ClipboardData(text: dataMap.toString())).then((value) {
|
||||
showDialog(context: context, builder: (context) => const AlertDialog(content: Text("Unformatiertes JSON wurde erfolgreich in deiner Zwischenablage abgelegt.")));
|
||||
showDialog(context: context, builder: (context) => const AlertDialog(content: Text('Unformatiertes JSON wurde erfolgreich in deiner Zwischenablage abgelegt.')));
|
||||
});
|
||||
}, child: const Text("Inline Kopieren")),
|
||||
TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text("Schließen"))
|
||||
}, child: const Text('Inline Kopieren')),
|
||||
TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text('Schließen'))
|
||||
],
|
||||
);
|
||||
});
|
||||
|
Reference in New Issue
Block a user