generateAsyncGetter function

Method generateAsyncGetter (FieldElement field)

Implementation

Method generateAsyncGetter(FieldElement field) {
  Code code = Code(asyncGetterCodeForField(field));

  return Method((b) => b
    ..name = "${field.name}Async"
    ..modifier = MethodModifier.async
    ..body = code
    ..returns = refer("Future<${field.type.displayName}>"));
}