GrpcServiceGenerator constructor
GrpcServiceGenerator(
- ServiceDescriptorProto _descriptor,
- 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';
}