generateInterfaceGetter method

void generateInterfaceGetter(
  1. ProtobufField field,
  2. IndentingWriter out,
  3. List<int> memberFieldPath
)

Implementation

void generateInterfaceGetter(
    ProtobufField field, IndentingWriter out, List<int> memberFieldPath) {
  final fieldTypeString = field.getInterfaceType();
  final names = field.memberNames;

  final commentBlock = fileGen.commentBlock(memberFieldPath);
  if (commentBlock != null) {
    out.println(commentBlock.trim());
  }

  _emitDeprecatedIf(field.isDeprecated, out);

  out.printlnAnnotated('$fieldTypeString get ${names!.fieldName};', [
    NamedLocation(
        name: names.fieldName,
        fieldPathSegment: memberFieldPath,
        start: '$fieldTypeString get '.length),
  ]);
}