getDartType method

String getDartType()

Returns the expression to use for the Dart type.

Implementation

String getDartType() {
  if (isMapField) {
    final d = baseType.generator as MessageGenerator;
    final keyType = d._fieldList[0].baseType.getDartType(parent.fileGen!);
    final valueType = d._fieldList[1].baseType.getDartType(parent.fileGen!);
    return '$coreImportPrefix.Map<$keyType, $valueType>';
  }
  if (isRepeated) return baseType.getRepeatedDartType(parent.fileGen!);
  return baseType.getDartType(parent.fileGen!);
}