gRPC, ProtoCol BUffers and Flutter on OSx

1k Views Asked by At

I'd like to use gRPC / ProtoBuffers between a Flutter/Dart app developed on OSx and a GoLang server. My thought is to replace a REST connection. My problem is that I cannot install Protobuf on OSx for DART.... or at least, I can't seem to figure it out.
This URL, towards the end, says that Protobuf for DART is only supported for Ubuntu. https://chromium.googlesource.com/external/github.com/google/protobuf/+/HEAD/README.md

QUESTIONS

  1. Is this correct that Protobuf on OSx for Dart Flutter is not working yet?
  2. Any tips or tricks to make it work? and I missing something here?
1

There are 1 best solutions below

3
kokemomuke On

First, you should install protobuf by homebrew. brew install protobuf If you don't have brew command, see how to install package manager HomeBrew for MacOsX.

Second, you should install Dart, see here https://www.dartlang.org/tools/sdk#install

Third, install plugin dart-protoc-plugin https://github.com/dart-lang/dart-protoc-plugin#how-to-build-and-use

Fourth, see this guide how to generate .dart classes https://developers.google.com/protocol-buffers/docs/darttutorial

Fifth, follow this guide for dart-grpc https://grpc.io/docs/tutorials/basic/dart.html