updated project style guidelines
This commit is contained in:
@ -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'))
|
||||
],
|
||||
);
|
||||
});
|
||||
));
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user