setConstractorBody method
Implementation
String setConstractorBody(
String apiClassName,
Map map, [
bool isMultipart = false,
List<String> paramPath = const [],
]) {
final variable = map.keys;
if (variable.isEmpty && paramPath.isEmpty) {
return 'const $apiClassName(${isMultipart ? '{ this.files }' : ''});';
}
return '''const $apiClassName({
${isMultipart ? 'this.files,' : ''}
${paramPath.map((e) => 'required this.${e.camelCase},').join(' \n')}
${variable.map((e) => 'this.${e.toString().camelCase},').join(' \n')}
});''';
}