PackageTrack
Sign in Get early access

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 2025
2018 2019 2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 60 of 71
  1. 25.0.0 26 Nov 2025
    Release notes

    Note: this version requires protobuf 6.0.0.

    Open source →
    Release notes

    Note: this version requires protobuf 5.2.0.

    Open source →
  2. 24.0.0 04 Nov 2025
    Release notes
    • 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>[].

    Open source →
    Release notes
    • 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>[].

    Open source →
  3. 23.0.0 30 Sep 2025
    Release notes

    Note: this version requires protobuf 5.0.0.

    • Support protobuf editions. (#1052)
    • Update generated code for protobuf 5.0.0.
    • Update generated clone members to take advantage of faster deepCopy implementation in protobuf 5.0.0. (#742)
    • Code size improvements for enum fields. (#1047)
    Open source →
    Release notes

    Note: this version requires protobuf 5.0.0.

    • Support protobuf editions. (#1052)
    • Update generated code for protobuf 5.0.0.
    • Update generated clone members to take advantage of faster deepCopy implementation in protobuf 5.0.0. (#742)
    • Code size improvements for enum fields. (#1047)
    Open source →
  4. 22.5.0 16 Jul 2025
    Release notes
    • 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.
    • Minimum SDK dependency bumped from 3.6.0 to 3.7.0. (#1024)
    Open source →
    Release notes
    • 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.
    • Minimum SDK dependency bumped from 3.6.0 to 3.7.0. (#1024)
    Open source →
  5. 22.4.0 24 Jun 2025
    Release notes
    • Update how we calculate import prefixes (#1010); import prefixes are now
      unique per-library instead of being unique across all generated libraries.
    • Ignore unused_import diagnostics for *.pbjson.dart files. (#1013)
    • Revert the change to not generate empty *.pbenum.dart files; 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)
    Open source →
    Release notes
    • Update how we calculate import prefixes (#1010); import prefixes are now unique per-library instead of being unique across all generated libraries.
    • Ignore unused_import diagnostics for *.pbjson.dart files. (#1013)
    • Revert the change to not generate empty *.pbenum.dart files; 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)
    Open source →
  6. 22.3.0 28 May 2025
    Release notes
    • 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_imports for some generated files.
    Open source →
  7. 22.2.0 19 May 2025
    Release notes
    • 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)

    Open source →
  8. 22.1.0 13 May 2025
    Release notes
    • Fix factory argument types for protobuf Map fields. (#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.
    Open source →
  9. 22.0.1 28 Mar 2025
    Release notes
    • Bump protobuf constraint to ^4.0.0
    Open source →
  10. 22.0.0 28 Mar 2025
    Release notes
    • 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)

    Open source →
  11. 21.1.2 10 Oct 2023
    Release notes
    • Fix a bug in comment parsing. (#871, #879)
    Open source →
  12. 21.1.1 15 Aug 2023
    Release notes
    • Rename a local variable used with message constructors to avoid potential conflicts with protobuf field names.
    Open source →
  13. 21.1.0 14 Aug 2023
    Release notes
    • 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>:.' ...
      

      (#850, #855)

    Open source →
  14. 21.0.2 19 Jun 2023
    Release notes
    • Fix missing protobuf import in generated grpc files. (#844)
    Open source →
  15. 21.0.1 16 Jun 2023 withdrawn
    Release notes

    (Bad release, retracted)

    Open source →
  16. 21.0.0 15 Jun 2023
    Release notes
    • 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)

    Open source →
  17. 20.0.1 15 Jun 2022
    Release notes
    • Fix proto3 repeated field encoding without the packed option (#345, #635)
    Open source →
  18. 20.0.0 11 Feb 2021
    Release notes
    • Stable release generating null-safe code.
    Open source →
  19. 20.0.0-nullsafety.1 07 Jan 2021 pre-release

    Nothing published for this version

  20. 20.0.0-nullsafety.0 13 Nov 2020 pre-release

    Nothing published for this version

  21. 19.3.1 05 Feb 2021
    Release notes
    • Emit binary coded descriptors, which can be used to reflect over the options given to the descriptor.
    Open source →
  22. 19.3.0 05 Jan 2021
    Release notes
    • Generate constructors with optional named arguments for prefilling fields.
    • Output language version 2.7 in generated files to support extension methods.
    Open source →
  23. 19.2.0 12 Nov 2020
    Release notes
    • Support client interceptors for gRPC. Requires grpc package 2.8.0 or newer.
    Open source →
  24. 19.2.0+1 12 Nov 2020
    Release notes
    • Fix syntax error introduced by gRPC client interceptor changes.
    Open source →
  25. 19.1.0 28 Oct 2020
    Release notes
    • 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.

    Open source →
  26. 19.0.1 30 Sep 2019
    Release notes
    • Fix: avoid naming collisions with Int64 and enum names beginning with digits after an initial underscore.
    Open source →
  27. 19.0.0 26 Sep 2019
    Release notes
    • 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 with pub global activate protoc_plugin 19.0.0
      • GeneratedMessage classes now have methods ensureX for each message field X.
      • Add specialized getters for String, int, and bool with usual default values.
      • Annotate generated accessors with the tag number of the associated field.
    • 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.
    Open source →
  28. 19.0.0+1 30 Sep 2019
    Release notes
    • Updated protobuf dependency to '>=0.14.4 <2.0.0' to allow 1.0.0.
    Open source →
  29. 18.0.1 10 Sep 2019
    Release notes
    • Add a bin/protoc-gen-dart.bat script making it easier to compile on windows using a local checkout.
    Open source →
  30. 18.0.0 06 Sep 2019
    Release notes
    • 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:

      • Fields with a name that was disambiguated to not clash with other dart entities.
      • fields with an explicit json_name option.
      • 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 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.

    Open source →
  31. 17.0.5 19 Jul 2019
    Release notes
    • Remove unnecessary cast from generated grpc stubs.
    Open source →
  32. 17.0.4 02 Jul 2019
    Release notes
    Open source →
  33. 17.0.2 25 Jun 2019
    Release notes
    • Fix: Avoiding argument_type_not_assignable and return_of_invalid_type lint warnings.
    Open source →
  34. 17.0.1 11 Jun 2019
    Release notes
    • Fix: Actually use prefixed imports from .pbserver, .pb.json, .pbgrpc files.
    Open source →
  35. 17.0.0 05 Jun 2019
    Release notes
    • Breaking change: seal protobuf message classes by using an internal private constructor and changing the rest to factories.
    Open source →
  36. 16.0.7 04 Jun 2019
    Release notes
    • Always prefix .pb.dart imports in .pbserver, .pb.json, .pbgrpc files.
    Open source →
  37. 16.0.5 04 Apr 2019
    Release notes
    • Fix generation of invalid Dart code for oneof enums by adding list of reserved enum names.
    Open source →
  38. 16.0.1 26 Feb 2019
    Release notes
    • Add DateTime conversion methods to google.protobuf.Timestamp.
    Open source →
  39. 16.0.0 25 Feb 2019
    Release notes
    • Add ability to generate Kythe metadata files via the generate_kythe_info option.
    • 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.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.
    Open source →
  40. 15.0.3 04 Feb 2019
    Release notes
    • Add test for frozen messages with unknown fields and update protobuf dependency to 0.13.1.
    Open source →
  41. 15.0.2 24 Jan 2019
    Release notes
    • The generated pbgrpc.dart files now import package:grpc/grpc.dart with a prefix.
    Open source →
  42. 15.0.1 22 Jan 2019
    Release notes
    • Add test for frozen messages with extension fields and update protobuf dependency to 0.13.0.
    Open source →
  43. 15.0.0 15 Jan 2019
    Release notes
    • 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.
    Open source →
  44. 14.0.1 10 Jan 2019
    Release notes
    • 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.
    Open source →
  45. 14.0.0 08 Jan 2019
    Release notes
    • Breaking change: generated message classes now have a new instance method 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.
    Open source →
  46. 13.0.1 08 Jan 2019
    Release notes
    • Add test for recursive merging and update protobuf dependency to 0.10.7.
    Open source →
  47. 13.0.0 02 Jan 2019
    Release notes
    • Breaking change: Support for oneof Generated files require package:protobuf version 0.10.6 or newer.
    Open source →
  48. 12.0.0 06 Dec 2018
    Release notes
    • 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__.

    Open source →
  49. 11.0.0 04 Dec 2018
    Release notes
    • 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.

    Open source →
  50. 0.10.5 11 Oct 2018
    Release notes
    • Generated files now import dart:async with a prefix to prevent name collisions.
    Open source →
  51. 0.10.4 02 Oct 2018
    Release notes
    • Change the fully qualified message name of generated messages to use BuilderInfo.qualifiedMessageName. Requires package:protobuf version 0.10.4 or newer.
    Open source →
  52. 0.10.3 25 Sep 2018
    Release notes
    • 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.
    Open source →
  53. 0.10.2 07 Sep 2018
    Release notes
    • Add link to source file in generated code.
    Open source →
  54. 0.10.1 06 Sep 2018
    Release notes
    • Prefix generated Dart proto imports by proto file path instead of by package. Tighten up member name checks for generated enum classes.
    Open source →
  55. 0.10.0 31 Aug 2018
    Release notes
    • Breaking change: Support for any messages. Generated files require package:protobuf version 0.10.1 or newer. BuilderInfo.messageName will now be the fully qualified name for generated messages.
    Open source →
  56. 0.9.0 30 Aug 2018
    Release notes
    • Breaking change: Add copyWith() to message classes and update getDefault() to use freeze(). Requires package:protobuf version 0.10.0 or newer.
    Open source →
  57. 0.8.2 28 Aug 2018
    Release notes
    • Generated code now imports 'package:protobuf/protobuf.dart' prefixed. This avoids name clashes between user defined message names and the protobuf library.
    Open source →
  58. 0.8.1 09 Aug 2018
    Release notes
    • Adjust dependencies to actually be compatible with Dart 2.0 stable.
    Open source →
  59. 0.8.0 17 May 2018
    Release notes
    • Breaking change: Generated RpcClient stubs use the generic invoke method. Requires package:protobuf version 0.8.0 or newer.
    • Dart 2 fixes.
    Open source →
  60. 0.8.0+1 07 Aug 2018
    Release notes
    • Dart SDK upper constraint raised to declare compatibility with Dart 2.0 stable.
    Open source →

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive