grpc-dart/example/route_guide
Slava Egorov 9a0b4642ef
Allow 4.0.0 version for protobuf dependency and prepare to release 4.0.3 (#774)
Fixes https://github.com/grpc/grpc-dart/issues/768
2025-03-31 15:42:24 +02:00
..
bin Enable and fix pedantic v1.9 lints (#445) 2021-02-01 09:12:26 +01:00
data Rename examples to example. (#19) 2017-07-04 19:50:18 +02:00
lib/src Regenerate protobuf types with new protobuf version (#658) 2023-08-16 05:33:31 -07:00
protos Rename examples to example. (#19) 2017-07-04 19:50:18 +02:00
README.md Remove superfluous 'is'. (#81) 2018-04-05 13:50:40 +02:00
analysis_options.yaml Migrate examples to Dart null safety (#536) 2022-01-04 10:05:22 +10:00
pubspec.yaml Allow 4.0.0 version for protobuf dependency and prepare to release 4.0.3 (#774) 2025-03-31 15:42:24 +02:00

README.md

Description

The route guide server and client demonstrate how to use Dart gRPC libraries to perform unary, client streaming, server streaming and full duplex RPCs.

See the definition of the route guide service in protos/route_guide.proto.

Run the sample code

To compile and run the example, assuming you are in the root of the route_guide folder, i.e., .../example/route_guide/, first get the dependencies by running:

$ pub get

Then, to run the server:

$ dart bin/server.dart

Likewise, to run the client:

$ dart bin/client.dart

Regenerate the stubs

If you have made changes to the message or service definition in protos/route_guide.proto and need to regenerate the corresponding Dart files, you will need to have protoc version 3.0.0 or higher and the Dart protoc plugin version 0.7.9 or higher on your PATH.

To install protoc with Dart support, take these steps:

  1. Install the protoc matching your development operating system from the Protocol Buffers releases page (e.g. protoc-3.5.1-osx-x86_64.zip for macOS).

  2. Get the Dart protoc plugin by running

    $ pub global activate protoc_plugin
    
  3. Add ~/.pub-cache/bin to your PATH, if you haven't already done so.

You can now regenerate the Dart files by running

$ protoc --dart_out=grpc:lib/src/generated -Iprotos protos/route_guide.proto