importPrefix method

String importPrefix(
  1. ProtobufContainer container
)

Get the import prefix of container in the current file generator.

Note that just calling this does not import the container in the current file. This just assigns an prefix to the container in the current file generator.

Implementation

String importPrefix(ProtobufContainer container) {
  final protoFilePath = container.fileGen!.protoFileUri.toString();
  return _importPrefixes.putIfAbsent(
    protoFilePath,
    () => '\$${_importPrefixes.length}',
  );
}