brew install protobuf
brew tap dart-lang/dart
brew install dart
pub global activate protoc_plugin
设置环境变量:
Installed executable protoc-gen-dart. Warning: Pub installs executables into $HOME/.pub-cache/bin, which is not on your path. You can fix that by adding this to your shell's config file (.bashrc, .bash_profile, etc.): export PATH="$PATH":"$HOME/.pub-cache/bin"