getBodyClass method
Implementation
String getBodyClass(
String suffix,
String name,
String parent,
Map? map, [
bool root = false,
bool isMultipart = false,
List<String> paramPath = const [],
]) {
if (map == null) return '';
final apiClassName = ModelClassNameHelper.getClassName(
listClassNameBody, suffix, name, root, true, parent);
final classString = '''class $apiClassName extends Equatable {
${setConstractorBody(apiClassName, map, isMultipart, paramPath)}
${setTypeData(map, suffix, listClassNameBody, apiClassName, isMultipart, paramPath)}
${toMapBody(map)}
${setPropsEquatable(map, isMultipart, paramPath)}
}
${map.keys.map((e) => map[e] is Map ? getBodyClass(suffix, e.toString().pascalCase, apiClassName, map[e], false) : '').join()}
${map.keys.map((e) => map[e] is List ? map[e] == null ? '' : (map[e] as List).isEmpty ? '' : (map[e] as List).first is! Map ? '' : getBodyClass(suffix, e.toString().pascalCase, apiClassName, (map[e] as List).first, false) : '').join()}
''';
return classString;
}