Future<void> save(String fileName) async { final file = File(fileName); final encoder = JsonEncoder.withIndent(' '); final jsonString = encoder.convert(toJson()); await file.writeAsString(jsonString); }