buildMapperImplementation function
Generates the implemented mapper method by the given abstract MethodElement
.
Implementation
Method buildMapperImplementation(Map<String, List<DartObject>> config, ClassElement model) {
var paramBuilder = ParameterBuilder();
paramBuilder.type = refer(model.name);
paramBuilder.name = 'model';
return Method((b) => b
..name = 'validate'
..returns = refer('List<ValidationError>')
..requiredParameters.add(paramBuilder.build())
..body = _generateBody(config, model)
);
}