toJsonFunctions method
Implementation
String toJsonFunctions(String className) {
var result = '';
bool find(DartDeclaration e) => e.name != null && e.ignored == false;
final fromJsonBody = where(find).map((e) => e.fromJsonBody()).join(',\n').trim().indented();
final toJsonBody = where(find).map((e) => e.toJsonBody(className)).join(',\n').trim().indented();
result = 'factory $className.fromJson(Map<String,dynamic> json) => $className(\n$fromJsonBody\n);\n\n';
result += 'Map<String, dynamic> toJson() => {\n$toJsonBody\n};';
return result.indented();
}