NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #803 most downloaded on pub.dev
A protobuf protoc compiler plugin used to generate Dart code.
Last release 27 days ago
11 Sep 2026
Ships unpredictably
gaps range from 2 weeks to 1.5 years
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
9 years old
72 releases · first in 2017
Deprecate create method. Users should use constructor or constructor tear-off instead.
Deprecate create method. Users should use constructor or constructor
tear-off instead.
Introduce $_createMessage method that will return GeneratedMessage. Users
shouldn't use this method, it is intended to be used by other generated proto
message classes in BuilderInfo method calls.
Using this generator requires using package:protobuf 6.1.0
Note: this version requires protobuf 6.0.0.
Note: this version requires protobuf 6.0.0.
One column per quarter.
Note: this version requires protobuf 5.2.0.
Breaking: Don't generate createRepeated methods.
Breaking: Don't generate createRepeated methods.
These methods are not too useful as there isn't much you can do with a PbList that you can't do with a List.
To migrate, replace MyMessage.createRepeated() with <MyMessage>[].
Note: this version requires protobuf 5.0.0.
Generated files are now formatted using the Dart formatter. The code is formatted using the min. SDK for package:protoc_plugin ; currently 3.7.0 .
package:protoc_plugin; currently 3.7.0.Update how we calculate import prefixes ( #1010 ); import prefixes are now unique per-library instead of being unique across all generated libraries.
unused_import diagnostics for *.pbjson.dart files. (#1013)*.pbenum.dart files; these can beUpdate the generated code to improve readability and to better follow common Dart patterns.
*.pbenum.dart) files.*.pbserver.dart) files.implementation_imports for some generated files.Adjust the deprecation messages for the message clone() and copyWith() methods ([#998]).
Bump protobuf constraint to ^4.1.0
Read default_host and oauth_scopes options from gRPC service definitions
and write that information to the generated gRPC clients.
Adjust the deprecation messages for the message clone() and copyWith()
methods ([#998]).
Generate dartdocs for grpc services (#973).
We now parse and generate code cooresponding to the proto options
google.api.default_host and google.api.oauth_scopes:
service Firestore {
option (google.api.default_host) = "firestore.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform,"
"https://www.googleapis.com/auth/datastore";
...
Will generate as:
class FirestoreClient extends $grpc.Client {
/// The hostname for this service.
static const $core.String defaultHost = 'firestore.googleapis.com';
/// OAuth scopes needed for the client.
static const $core.List<$core.String> oauthScopes = [
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/datastore',
];
...
Minimum SDK dependency bumped from 3.3.0 to 3.6.0. (#1001)
Fix factory argument types for protobuf Map fields. ([#975])
Map fields. (#975)protoc.
(#952)Bump protobuf constraint to ^4.0.0
protobuf constraint to ^4.0.0deprecated options in messages, grpc services and methods, and enum types and values are now handled to generate Dart @deprecated annotations. ([#900]…
Remove PbEventMixin mixin. (#738)
Type of repeated fields is now PbList (instead of List), type of map
fields is now PbMap (instead of Map). (#903)
This change requires protobuf-4.0.0.
Generated files now export GeneratedMessageGenericExtensions from the
protobuf library. (#503, #907)
Generate doc comments for enum types and values, rpc services and methods. (#900, #909)
deprecated options in messages, grpc services and methods, and enum types
and values are now handled to generate Dart @deprecated annotations.
(#900, #908)
protoc_plugin and generated files now require Dart 3.3.0. (#953)
Fix performance issues when handling documentation comments in protobufs. (#935, #955)
Fix grpc methods with names 'call' and 'request' conflicting with other methods in the generated code and causing compile-time errors. (#963, #159)
Fix a bug in comment parsing. ([#871], [#879])
Rename a local variable used with message constructors to avoid potential conflicts with protobuf field names.
Generate code comments for annotated protobuf inputs. ([#161])
Generate code comments for annotated protobuf inputs. (#161)
Generate message constructor arguments by default again. New flag
disable_constructor_args disables generating the arguments.
Constructor arguments were removed in 21.0.0 as they increase dart2js binary sizes even when the arguments are not used.
Example usage to disable constructor arguments:
protoc --dart_out='disable_constructor_args,<other options>:.' ...
Fix missing protobuf import in generated grpc files. ([#844])
(Bad release, retracted)
(Bad release, retracted)
Identifiers fromBuffer, fromJson, $_defaultFor, initByValue are no longer reserved. Proto fields with those Dart names will no longer have a suffix ad
Identifiers fromBuffer, fromJson, $_defaultFor, initByValue are no
longer reserved. Proto fields with those Dart names will no longer have a
suffix added. (#679)
Remove message constructor arguments. Constructors with arguments cause increase in release binary sizes even when no arguments are passed to the constructors. (#703)
Migration:
Set the fields after construction, using cascade syntax. For example, if you have:
MyMessage(a: 123, b: [1, 2, 3])
You can do:
MyMessage()
..a = 123
..b.addAll([1, 2, 3])
Require Dart 2.19.
Export public dependencies (import publics in proto files) in
.pbenum.dart files, same as .pb.dart files. (9aad6aa)
Fix decoding map fields when key or value (or both) fields of a map entry is missing. (#719, #745)
Generated files now split ignore_for_file comments across multiple lines
when necessary. (#770)
Generated files now uses shared consts to eliminate repeated
bool.fromEnvironment() expressions. (#772)
Removed accidental /// at the top of generated Dart files to avoid new
dangling_library_doc_comments lint. (#774)
Generated files now have sorted imports and have fewer import-related
ignore_for_file: analysis directives. (#778)
Remove duplicated consts in generated files. (#773)
Fix proto3 repeated field encoding without the packed option ([#345], [#635])
Stable release generating null-safe code.
Nothing published for this version
Nothing published for this version
Emit binary coded descriptors, which can be used to reflect over the options given to the descriptor.
Generate constructors with optional named arguments for prefilling fields.
Fix syntax error introduced by gRPC client interceptor changes.
Support client interceptors for gRPC. Requires grpc package 2.8.0 or newer.
Emit depreciation of generated copyWith and clone methods.
Emit depreciation of generated copyWith and clone methods.
Emit exports of GeneratedMessageGenericExtensions from pb.dart files.
Make protobuf enum names dependent on a fromEnvironment constant.
This will allow configuring the omission of the names in the final build.
If a target is built with dart_env = {"protobuf.omit_enum_names": "true"}
enum names will not be present in the compiled binary.
Make message and field names depend on fromEnvironment constants
protobuf.omit_message_names and protobuf.omit_field_names respectively.
Omit type on a left hand side of generated static fields for extensions,
which results in stricter type (Extension<ExtensionType> instead of just
Extension).
Fix escaping of string default values.
Fix: avoid naming collisions with Int64 and enum names beginning with digits after an initial underscore.
Int64 and enum names beginning with digits
after an initial underscore.Updated protobuf dependency to '>=0.14.4 <2.0.0' to allow 1.0.0.
Breaking: Generates code that requires at least protobuf 0.14.4. If protoc_plugin is installed in your path with pub global activate you can upgrade w
protobuf 0.14.4.
If protoc_plugin is installed in your path with pub global activate you can upgrade with pub global activate protoc_plugin 19.0.0
ensureX for each message field X.String, int, and bool with usual default values.Add a bin/protoc-gen-dart.bat script making it easier to compile on windows using a local checkout.
bin/protoc-gen-dart.bat script making it easier to compile on windows using a local
checkout.Breaking: Generates code that requires at least protobuf 0.14.0.
Breaking: Generates code that requires at least protobuf 0.14.0.
Generate the non-camel-case name of fields when it cannot be derived from the json name.
Breaking: Use the correct proto3 Json CamelCase names for the string representation of field names (also for extensions), instead of using the name of the dart identifier for that field.
In most cases this name coincides with the name have emitted until now and require no change.
Exceptions are:
json_name option.For any field with an updated name, this might require changes to uses of
GeneratedMessage.getTagNumber(String FieldName), and calls to name-related methods of
GeneratedMessage._info.
GeneratedMessage.toString() also uses the string representation. It will now print the
json-name.
Well-known types (for now only google.protobuf.Any and google.protobuf.Timestamp) now uses a
mixin to add special handling code instead of hardcoding it in the compiler.
Remove unnecessary cast from generated grpc stubs.
Output language versioning headers in generated code. This prepares for forward compatibility with NNBD.
Fix: Avoiding argument_type_not_assignable and return_of_invalid_type lint warnings.
argument_type_not_assignable and return_of_invalid_type lint warnings.Fix: Actually use prefixed imports from .pbserver, .pb.json, .pbgrpc files.
Breaking change: seal protobuf message classes by using an internal private constructor and changing the rest to factories.
Always prefix .pb.dart imports in .pbserver, .pb.json, .pbgrpc files.
Fix generation of invalid Dart code for oneof enums by adding list of reserved enum names.
Add DateTime conversion methods to google.protobuf.Timestamp.
DateTime conversion methods to google.protobuf.Timestamp.Breaking change: Remove the '$checkItem' function from generated message classes and use the new method 'pc' on 'BuilderInfo' to add repeated composit…
generate_kythe_info option.*.pbgrpc.dart files now import package:grpc/service_api.dart
instead of package:grpc/grpc.dart.
Generated code needs at least package:grpc 1.0.1.Add test for frozen messages with unknown fields and update protobuf dependency to 0.13.1.
The generated pbgrpc.dart files now import package:grpc/grpc.dart with a prefix.
pbgrpc.dart files now import package:grpc/grpc.dart with a prefix.Add test for frozen messages with extension fields and update protobuf dependency to 0.13.0.
Breaking change: Changed BuilderInfo call for map fields to include the BuilderInfo object for map entries. Generated files require package:protobuf v…
Remove the benchmark from the protoc_package. It now lives in [https://github.com/google/protobuf.dart] as api_benchmark. This simplifies the dev_depe
api_benchmark.
This simplifies the dev_dependencies of this package.Breaking change: generated message classes now have a new instance method createEmptyInstance that is used to support the new toBuilder() semantics of…
createEmptyInstance
that is used to support the new toBuilder() semantics of protobuf 0.11.0.
The generated code requires at least protobuf 0.11.0.Add test for recursive merging and update protobuf dependency to 0.10.7.
Breaking change: Support for oneof Generated files require package:protobuf version 0.10.6 or newer.
Breaking change: Handle identifiers starting with a leading underscore. This covers message names, enum names, enum value identifiers and file names.
Breaking change: Handle identifiers starting with a leading underscore. This covers message names, enum names, enum value identifiers and file names.
Before, these would appear in the generated Dart code as private identifiers. Now the underscore is moved to the end.
Field names and extension field names already had all underscores removed, and these are not affected by this change.
If there is a conflicting name with a trailing underscore defined later in the same scope, a disambiguation will happen that can potentially lead to existing identifiers getting a new name in the generated Dart.
For example:
message _Foo {}
message Foo_ {}
_Foo will get the name Foo_ and Foo_ will now end up being called Foo__.
Breaking change: Support for map fields Generated files require package:protobuf version 0.10.5 or newer. Protobuf map fields such as:
Breaking change: Support for map fields Generated files require package:protobuf version 0.10.5 or newer. Protobuf map fields such as:
message Foo { map<int32, string> map_field = 1; } are now no longer represented as List<Foo_MapFieldEntry> but as Map<int, String>.
All code handling these fields needs to be updated.
Accidentally published as 11.0.0 instead of 0.11.0. Continuing from here.
Generated files now import dart:async with a prefix to prevent name collisions.
dart:async with a prefix to prevent name
collisions.Change the fully qualified message name of generated messages to use BuilderInfo.qualifiedMessageName. Requires package:protobuf version 0.10.4 or new
BuilderInfo.qualifiedMessageName.
Requires package:protobuf version 0.10.4 or newer.Remove runtime as check of enum valueOf by using correctly typed Map of values. Generated files must require package:protobuf version 0.10.3 or newer.
as check of enum valueOf by using correctly typed Map of
values.
Generated files must require package:protobuf version 0.10.3 or newer.Add link to source file in generated code.
Prefix generated Dart proto imports by proto file path instead of by package. Tighten up member name checks for generated enum classes.
Breaking change: Support for any messages. Generated files require package:protobuf version 0.10.1 or newer. BuilderInfo.messageName will now be the f…
BuilderInfo.messageName will now be the fully qualified name for generated messages.Breaking change: Add copyWith() to message classes and update getDefault() to use freeze(). Requires package:protobuf version 0.10.0 or newer.
copyWith() to message classes and update getDefault() to use freeze().
Requires package:protobuf version 0.10.0 or newer.Generated code now imports 'package:protobuf/protobuf.dart' prefixed. This avoids name clashes between user defined message names and the protobuf lib
Adjust dependencies to actually be compatible with Dart 2.0 stable.
Dart SDK upper constraint raised to declare compatibility with Dart 2.0 stable.
Your coding agent can read these notes before it upgrades. Set up the MCP server →