protoc_plugin
A protobuf protoc compiler plugin used to generate Dart code.
25.0.0
200K downloads/mo
#850 most downloaded on pub.dev
google/protobuf.dart
What this package is like to depend on
Last release 9 months ago
26 Nov 2025
Ships unpredictably
gaps range from 2 weeks to 1.5 years
Nearly every release is documented
notes for 68 of 68 stable releases
1 version withdrawn
withdrawn after publishing
9 years old
71 releases · first in 2017
3 releases in the last 12 months
see the full history below
Release timeline
71 releases · Jun 2017 to Nov 2025Releases
latest 60 of 71-
25.0.026 Nov 2025Release notes
Open source →Note: this version requires protobuf 6.0.0.
- Handle importing well-known protos. (#1081)
Release notes
Open source →Note: this version requires protobuf 5.2.0.
- Handle importing well-known protos. (#1081)
-
24.0.004 Nov 2025Release notes
Open source →-
Breaking: Don't generate
createRepeatedmethods.These methods are not too useful as there isn't much you can do with a
PbListthat you can't do with aList.To migrate, replace
MyMessage.createRepeated()with<MyMessage>[].
Release notes
Open source →-
Breaking: Don't generate
createRepeatedmethods.These methods are not too useful as there isn't much you can do with a
PbListthat you can't do with aList.To migrate, replace
MyMessage.createRepeated()with<MyMessage>[].
-
-
23.0.030 Sep 2025 -
22.5.016 Jul 2025Release notes
Open source →- Generated files are now formatted using the Dart formatter. The code is
formatted using the min. SDK forpackage:protoc_plugin; currently3.7.0. - Minimum SDK dependency bumped from 3.6.0 to 3.7.0. (#1024)
Release notes
Open source →- Generated files are now formatted using the Dart formatter. The code is
formatted using the min. SDK for
package:protoc_plugin; currently3.7.0. - Minimum SDK dependency bumped from 3.6.0 to 3.7.0. (#1024)
- Generated files are now formatted using the Dart formatter. The code is
-
22.4.024 Jun 2025Release notes
Open source →- Update how we calculate import prefixes (#1010); import prefixes are now
unique per-library instead of being unique across all generated libraries. - Ignore
unused_importdiagnostics for*.pbjson.dartfiles. (#1013) - Revert the change to not generate empty
*.pbenum.dartfiles; these can be
exported from other enum files. (#1016) - Improve the readablity of generated gRPC client files. (#1021)
- Adjust the text of generated file headers ('This is a generated file...').
(#1022)
Release notes
Open source →- Update how we calculate import prefixes (#1010); import prefixes are now unique per-library instead of being unique across all generated libraries.
- Ignore
unused_importdiagnostics for*.pbjson.dartfiles. (#1013) - Revert the change to not generate empty
*.pbenum.dartfiles; these can be exported from other enum files. (#1016) - Improve the readablity of generated gRPC client files. (#1021)
- Adjust the text of generated file headers ('This is a generated file...'). (#1022)
- Update how we calculate import prefixes (#1010); import prefixes are now
-
22.3.028 May 2025Release notes
Open source →- Update the generated code to improve readability and to better follow common Dart patterns.
- No longer generate empty enum (
*.pbenum.dart) files. - No longer generate empty server (
*.pbserver.dart) files. - Ignore
implementation_importsfor some generated files.
-
22.2.019 May 2025Release notes
Open source →-
Bump
protobufconstraint to^4.1.0 -
Read
default_hostandoauth_scopesoptions from gRPC service definitions and write that information to the generated gRPC clients. -
Adjust the deprecation messages for the message
clone()andcopyWith()methods ([#998]). -
Generate dartdocs for grpc services (#973).
We now parse and generate code cooresponding to the proto options
google.api.default_hostandgoogle.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)
-
-
22.1.013 May 2025Release notes
Open source →- Fix factory argument types for protobuf
Mapfields. (#975) - Fix import order changes when files are passed in different order to
protoc. (#952) - Add fromDart() and toDart() methods to convert between core Duration and proto Duration (#986)
- Update the GRPC service generator to emit constructors that use super parameters.
- Fix factory argument types for protobuf
-
22.0.128 Mar 2025 -
22.0.028 Mar 2025Release notes
Open source →-
Remove
PbEventMixinmixin. (#738) -
Type of repeated fields is now
PbList(instead ofList), type of map fields is nowPbMap(instead ofMap). (#903)This change requires protobuf-4.0.0.
-
Generated files now export
GeneratedMessageGenericExtensionsfrom the protobuf library. (#503, #907) -
Generate doc comments for enum types and values, rpc services and methods. (#900, #909)
-
deprecatedoptions in messages, grpc services and methods, and enum types and values are now handled to generate Dart@deprecatedannotations. (#900, #908) -
protoc_pluginand 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)
-
-
21.1.210 Oct 2023 -
21.1.115 Aug 2023Release notes
Open source →- Rename a local variable used with message constructors to avoid potential conflicts with protobuf field names.
-
21.1.014 Aug 2023Release notes
Open source →-
Generate code comments for annotated protobuf inputs. (#161)
-
Generate message constructor arguments by default again. New flag
disable_constructor_argsdisables 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>:.' ...
-
-
21.0.219 Jun 2023 -
21.0.116 Jun 2023 withdrawn -
21.0.015 Jun 2023Release notes
Open source →-
Identifiers
fromBuffer,fromJson,$_defaultFor,initByValueare 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.dartfiles, same as.pb.dartfiles. (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_filecomments 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 newdangling_library_doc_commentslint. (#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)
-
-
20.0.115 Jun 2022Release notes
Open source → -
20.0.011 Feb 2021 -
20.0.0-nullsafety.107 Jan 2021 pre-releaseNothing published for this version
-
20.0.0-nullsafety.013 Nov 2020 pre-releaseNothing published for this version
-
19.3.105 Feb 2021Release notes
Open source →- Emit binary coded descriptors, which can be used to reflect over the options given to the descriptor.
-
19.3.005 Jan 2021Release notes
Open source →- Generate constructors with optional named arguments for prefilling fields.
- Output language version 2.7 in generated files to support extension methods.
-
19.2.012 Nov 2020Release notes
Open source →- Support client interceptors for gRPC. Requires grpc package 2.8.0 or newer.
-
19.2.0+112 Nov 2020 -
19.1.028 Oct 2020Release notes
Open source →-
Emit depreciation of generated
copyWithandclonemethods. -
Emit exports of
GeneratedMessageGenericExtensionsfrompb.dartfiles. -
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_namesandprotobuf.omit_field_namesrespectively. -
Omit type on a left hand side of generated static fields for extensions, which results in stricter type (
Extension<ExtensionType>instead of justExtension). -
Fix escaping of string default values.
-
-
19.0.130 Sep 2019Release notes
Open source →- Fix: avoid naming collisions with
Int64and enum names beginning with digits after an initial underscore.
- Fix: avoid naming collisions with
-
19.0.026 Sep 2019Release notes
Open source →- Breaking: Generates code that requires at least
protobuf0.14.4. If protoc_plugin is installed in your path withpub global activateyou can upgrade withpub global activate protoc_plugin 19.0.0- GeneratedMessage classes now have methods
ensureXfor each message field X. - Add specialized getters for
String,int, andboolwith usual default values. - Annotate generated accessors with the tag number of the associated field.
- GeneratedMessage classes now have methods
- Breaking: Use unmangled names for the string representation of enum values. Mangled names would lead to wrong proto3 json en- and decoding.
- Annotate generated accessors with the tag number of the associated field.
- Breaking: Generates code that requires at least
-
19.0.0+130 Sep 2019 -
18.0.110 Sep 2019Release notes
Open source →- Add a
bin/protoc-gen-dart.batscript making it easier to compile on windows using a local checkout.
- Add a
-
18.0.006 Sep 2019Release notes
Open source →-
Breaking: Generates code that requires at least
protobuf0.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:
- Fields with a name that was disambiguated to not clash with other dart entities.
- fields with an explicit
json_nameoption. - groups have a different camel-casing scheme.
For any field with an updated name, this might require changes to uses of
GeneratedMessage.getTagNumber(String FieldName), and calls to name-related methods ofGeneratedMessage._info.GeneratedMessage.toString()also uses the string representation. It will now print the json-name. -
Well-known types (for now only
google.protobuf.Anyandgoogle.protobuf.Timestamp) now uses a mixin to add special handling code instead of hardcoding it in the compiler.
-
-
17.0.519 Jul 2019 -
17.0.402 Jul 2019Release notes
Open source →- Output language versioning headers in generated code. This prepares for forward compatibility with NNBD.
-
17.0.225 Jun 2019Release notes
Open source →- Fix: Avoiding
argument_type_not_assignableandreturn_of_invalid_type lint warnings.
- Fix: Avoiding
-
17.0.111 Jun 2019Release notes
Open source →- Fix: Actually use prefixed imports from .pbserver, .pb.json, .pbgrpc files.
-
17.0.005 Jun 2019Release notes
Open source →- Breaking change: seal protobuf message classes by using an internal private constructor and changing the rest to factories.
-
16.0.704 Jun 2019 -
16.0.504 Apr 2019Release notes
Open source →- Fix generation of invalid Dart code for oneof enums by adding list of reserved enum names.
-
16.0.126 Feb 2019 -
16.0.025 Feb 2019Release notes
Open source →- Add ability to generate Kythe metadata files via the
generate_kythe_infooption. - Breaking change: Remove the '$checkItem' function from generated message classes and use the new method 'pc' on 'BuilderInfo' to add repeated composite fields. Generated files require package:protobuf version 0.13.4 or newer.
- Breaking change: The generated
*.pbgrpc.dartfiles now importpackage:grpc/service_api.dartinstead ofpackage:grpc/grpc.dart. Generated code needs at least package:grpc 1.0.1.
- Add ability to generate Kythe metadata files via the
-
15.0.304 Feb 2019Release notes
Open source →- Add test for frozen messages with unknown fields and update protobuf dependency to 0.13.1.
-
15.0.224 Jan 2019Release notes
Open source →- The generated
pbgrpc.dartfiles now importpackage:grpc/grpc.dartwith a prefix.
- The generated
-
15.0.122 Jan 2019Release notes
Open source →- Add test for frozen messages with extension fields and update protobuf dependency to 0.13.0.
-
15.0.015 Jan 2019Release notes
Open source →- Breaking change: Changed BuilderInfo call for map fields to include the BuilderInfo object for map entries. Generated files require package:protobuf version 0.12.0 or newer.
-
14.0.110 Jan 2019Release notes
Open source →- Remove the benchmark from the protoc_package. It now lives in
[https://github.com/google/protobuf.dart] as
api_benchmark. This simplifies the dev_dependencies of this package.
- Remove the benchmark from the protoc_package. It now lives in
[https://github.com/google/protobuf.dart] as
-
14.0.008 Jan 2019Release notes
Open source →- Breaking change: generated message classes now have a new instance method
createEmptyInstancethat is used to support the newtoBuilder()semantics of protobuf 0.11.0. The generated code requires at least protobuf 0.11.0.
- Breaking change: generated message classes now have a new instance method
-
13.0.108 Jan 2019Release notes
Open source →- Add test for recursive merging and update protobuf dependency to 0.10.7.
-
13.0.002 Jan 2019Release notes
Open source →- Breaking change: Support for oneof Generated files require package:protobuf version 0.10.6 or newer.
-
12.0.006 Dec 2018Release notes
Open source →-
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_ {}_Foowill get the nameFoo_andFoo_will now end up being calledFoo__.
-
-
11.0.004 Dec 2018Release notes
Open source →-
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.
-
-
0.10.511 Oct 2018Release notes
Open source →- Generated files now import
dart:asyncwith a prefix to prevent name collisions.
- Generated files now import
-
0.10.402 Oct 2018Release notes
Open source →- Change the fully qualified message name of generated messages to use
BuilderInfo.qualifiedMessageName. Requires package:protobuf version 0.10.4 or newer.
- Change the fully qualified message name of generated messages to use
-
0.10.325 Sep 2018Release notes
Open source →- Remove runtime
ascheck of enumvalueOfby using correctly typedMapof values. Generated files must require package:protobuf version 0.10.3 or newer.
- Remove runtime
-
0.10.207 Sep 2018 -
0.10.106 Sep 2018Release notes
Open source →- Prefix generated Dart proto imports by proto file path instead of by package. Tighten up member name checks for generated enum classes.
-
0.10.031 Aug 2018Release notes
Open source →- Breaking change: Support for any messages.
Generated files require package:protobuf version 0.10.1 or newer.
BuilderInfo.messageNamewill now be the fully qualified name for generated messages.
- Breaking change: Support for any messages.
Generated files require package:protobuf version 0.10.1 or newer.
-
0.9.030 Aug 2018Release notes
Open source →- Breaking change: Add
copyWith()to message classes and updategetDefault()to usefreeze(). Requires package:protobuf version 0.10.0 or newer.
- Breaking change: Add
-
0.8.228 Aug 2018Release notes
Open source →- Generated code now imports 'package:protobuf/protobuf.dart' prefixed. This avoids name clashes between user defined message names and the protobuf library.
-
0.8.109 Aug 2018 -
0.8.017 May 2018Release notes
Open source →- Breaking change: Generated RpcClient stubs use the generic invoke method. Requires package:protobuf version 0.8.0 or newer.
- Dart 2 fixes.
-
0.8.0+107 Aug 2018Release notes
Open source →- Dart SDK upper constraint raised to declare compatibility with Dart 2.0 stable.