getDartType method

String getDartType()

Returns the type to use for the Dart field type.

Implementation

String getDartType() {
  if (isMapField) {
    final keyType = getDartMapKeyType();
    final valueType = getDartMapValueType();
    return '$protobufImportPrefix.PbMap<$keyType, $valueType>';
  }
  if (isRepeated) return baseType.getRepeatedDartType(parent.fileGen!);
  return baseType.getDartType(parent.fileGen!);
}