updated project style guidelines

This commit is contained in:
2024-04-03 19:18:17 +02:00
parent 27618f4404
commit 4c7f53e309
185 changed files with 505 additions and 873 deletions

View File

@ -9,8 +9,7 @@ class JsonViewer extends StatelessWidget {
const JsonViewer({super.key, required this.title, required this.data});
@override
Widget build(BuildContext context) {
return Scaffold(
Widget build(BuildContext context) => Scaffold(
appBar: AppBar(
title: Text(title),
),
@ -19,16 +18,11 @@ class JsonViewer extends StatelessWidget {
child: Text(format(data)),
),
);
}
static String format(Map<String, dynamic> jsonInput) {
return prettyJson(jsonInput, indent: 2);
//return jsonInput.replaceAllMapped(RegExp(r'[{,}]'), (match) => "${match.group(0)}\n ");
}
static String format(Map<String, dynamic> jsonInput) => prettyJson(jsonInput, indent: 2);
static void asDialog(BuildContext context, Map<String, dynamic> dataMap) {
showDialog(context: context, builder: (context) {
return AlertDialog(
showDialog(context: context, builder: (context) => AlertDialog(
scrollable: true,
title: const Row(children: [Icon(Icons.bug_report_outlined), Text('Rohdaten')]),
content: Text(JsonViewer.format(dataMap)),
@ -45,7 +39,6 @@ class JsonViewer extends StatelessWidget {
}, child: const Text('Inline Kopieren')),
TextButton(onPressed: () => Navigator.of(context).pop(), child: const Text('Schließen'))
],
);
});
));
}
}