setValueVariableMapper method
Implementation
String setValueVariableMapper(
String key, dynamic value, TypeMapper typeMapper) {
if (value is List && value.firstOrNull is Map) {
return '${key.camelCase}?.map((e) => e.${typeMapper == TypeMapper.toEntity ? 'toEntity' : 'toResponse'}()).toList()';
} else if (value is Map) {
return '${key.camelCase}?.${typeMapper == TypeMapper.toEntity ? 'toEntity' : 'toResponse'}()';
} else {
return key.camelCase;
}
}