GrpcServiceGenerator constructor

GrpcServiceGenerator(
  1. ServiceDescriptorProto _descriptor,
  2. FileGenerator fileGen
)

Implementation

GrpcServiceGenerator(this._descriptor, this.fileGen) {
  final name = _descriptor.name;
  final package = fileGen.package;

  if (package.isNotEmpty) {
    _fullServiceName = '$package.$name';
  } else {
    _fullServiceName = name;
  }

  // avoid: ClientClient
  _clientClassname = name.endsWith('Client') ? name : '${name}Client';
  // avoid: ServiceServiceBase
  _serviceClassname =
      name.endsWith('Service') ? '${name}Base' : '${name}ServiceBase';
}