setConstractor method
Implementation
String setConstractor(
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) => 'this.${e.camelCase},').join(' \n')}
${variable.map((e) => 'this.${e.toString().camelCase},').join(' \n')}
});''';
}