Closed BorzdeG closed 2 years ago
Some proto files do not generate dart code correctly
pubspec.lock :
grpc: dependency: "direct main" description: name: grpc url: "https://pub.dartlang.org" source: hosted version: "3.0.2"
syntax = "proto3"; package demo; option go_package = "./demo"; import "google/protobuf/empty.proto"; message DemoResponse { string name = 1; } service DemoService { rpc Say (google.protobuf.Empty) returns (DemoResponse); }
generate Dart code: protoc --proto_path=proto --dart_out=grpc:lib/src/generated demo.proto
protoc --proto_path=proto --dart_out=grpc:lib/src/generated demo.proto
Added Dart dependencies: dart pub add protobuf http2 grpc
dart pub add protobuf http2 grpc
Open demo.pbgrpc.dart file
demo.pbgrpc.dart
Expected result: All imports are correct
Actual result:
You currently need to generate empty.pb.dart yourself: https://github.com/google/protobuf.dart/issues/170
empty.pb.dart
Some proto files do not generate dart code correctly
pubspec.lock :
Repro steps
generate Dart code:
protoc --proto_path=proto --dart_out=grpc:lib/src/generated demo.proto
Added Dart dependencies:
dart pub add protobuf http2 grpc
Open
demo.pbgrpc.dart
fileExpected result: All imports are correct
Actual result: