buildStaticMapperImplementation function

Method buildStaticMapperImplementation(
  1. Map<String, dynamic> config,
  2. MethodElement method,
  3. ClassElement abstractMapper
)

Generates the implemented mapper method by the given abstract MethodElement.

Implementation

Method buildStaticMapperImplementation(Map<String, dynamic> config,
    MethodElement method, ClassElement abstractMapper) {
  return Method(
        (b) => b
      ..name = '_\$${method.name}'
      ..requiredParameters.addAll(method.parameters.map((e) => copyParameter(e)))
      ..body = _generateBody(config, method, abstractMapper)
      ..returns =
      refer(method.returnType.getDisplayString(withNullability: true)),
  );
}