Skip to content
Snippets Groups Projects
Commit 5a8cc4b5 authored by Maximilian Betz's avatar Maximilian Betz
Browse files

corrected wrong json format in dump file

parent 9910d64b
No related branches found
No related tags found
No related merge requests found
......@@ -53,7 +53,8 @@ class _MyHomePageState extends State<Configuration> {
String filepath = join(directory.path, filename);
final File file = File(filepath);
await file.writeAsString(eventsJson);
String dumpStr = "{\"events\":" + eventsJson + "}";
await file.writeAsString(dumpStr);
debugPrint('Stored file at: ' + filepath);
setState(() {});
......
......@@ -125,12 +125,14 @@ abstract class DatabaseConnector{
// Create a json readable event dump
Future<String> eventDump() async {
List<Event> events = await getEvents();
String ev = '[';
var ev = '[';
for (var event in events) {
ev += jsonEncode(event);
ev += ',';
}
ev = ev.substring(0, ev.length - 1); // Remove last ,
ev += ']';
return ev;
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment