generateGetter function

Method generateGetter (FieldElement field)

Implementation

Method generateGetter(FieldElement field) {
  Code code = Code(cacheGetterCodeForField(field));

  return Method((b) => b
    ..name = field.name
    ..body = code
    ..returns = refer(field.type.displayName)
    ..type = MethodType.getter);
}