protobuf_runner 1.0.0

  • Installing
  • Versions
  • 0


Builds Dart protocol buffers.


Make a protobuf file:

syntax = "proto2";

package address_book;

message Person {
    required string name = 1;
    required int32 id = 2;
    optional string email = 3;

    enum PhoneType {
        MOBILE = 0;
        HOME = 1;
        WORK = 2;

    message PhoneNumber {
        required string number = 1;
        optional PhoneType type = 2 [default = HOME];

    repeated PhoneNumber phones = 4;

message AddressBook {
    repeated Person people = 1;

Run the command:

pbuf address_book.proto

Enjoy your new Protocol Buffer!

import 'package:dart_protobuf_example/address_book.pb.dart';

main() {
  var people = [
    new Person() = "Jack Ryan" = "",
    new Person() = "Brad Ryan" = ""
  var x = new AddressBook();
  // prints {"1":[{"1":"Jack Ryan","3":""},{"1":"Brad Ryan","3":""}]}

Getting Started:

Install the latest protoc command:

brew install protoc

Install dart_protoc_plugin on your machine:

git clone
cd dart-protoc-plugin
pub get

Install this tool:

pub global activate protobuf_runner


Option 1: using the DART_PROTOC_PLUGIN environment variable:

export DART_PROTOC_PLUGIN=/path/to/dart-protoc-plugin 
pbuf /path/to/project/lib/address_book.proto

Option 2: using the --plugin flag:

pbuf --plugin=/path/to/dart-protoc-plugin /path/to/project/lib/address_book.proto


to install locally:

pub global activate --source path  /path/to/protobuf_runner/


Please use the Issue Tracker



  • Initial version, created by Stagehand

Use this package as an executable

1. Install it

You can install the package from the command line:

$ pub global activate protobuf_runner

2. Use it

The package has the following executables:

$ pbuf
Version Uploaded Documentation Archive
1.0.0 Mar 5, 2017 Go to the documentation of protobuf_runner 1.0.0 Download protobuf_runner 1.0.0 archive
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see

Maintenance issues and suggestions

Running dartdoc failed. (-10 points)

Make sure dartdoc runs without any issues.


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0