protobuf
Runtime library for protocol buffers support. Use with package:protoc_plugin to generate Dart code for your '.proto' files.
6.0.0
2.0M downloads/mo
#258 most downloaded on pub.dev
google/protobuf.dart
What this package is like to depend on
Last release 9 months ago
26 Nov 2025
Release timing varies
gaps range from 3 weeks to 1.6 years
Most releases are documented
notes for 81 of 92 stable releases
Nothing withdrawn
no release was ever pulled
13 years old
94 releases · first in 2013
3 releases in the last 12 months
see the full history below
Release timeline
94 releases · Sep 2013 to Nov 2025Releases
latest 60 of 94-
6.0.026 Nov 2025Release notes
Open source →-
New
GeneratedMessageextension methodstoTextFormatandwriteTextFormatadded to convert the message into the official protocol buffers text format. (#1080, #125) -
Add well-known proto types as libraries. This change is required for protoc_plugin-25.0.0. (#1081)
-
Breaking: Hide
PbListandPbMapconstructors. It is not possible to construct these values correctly in user code, so the constructors are now private. Existing uses ofPbListcan be replaced byListandPbMapcan be replaced byMap.For immutable lists and maps, you can use
built_value. (#1072) -
Map fields now check key and value validity when adding elements. (#1065, #1076)
Release notes
Open source →-
New
GeneratedMessageextension methodstoTextFormatandwriteTextFormatadded to convert the message into the official protocol buffers text format. (#1080, #125) -
Add well-known proto types as libraries. This change is required for protoc_plugin-25.0.0. (#1081)
-
Breaking: Hide
PbListandPbMapconstructors. It is not possible to construct these values correctly in user code, so the constructors are now private. Existing uses ofPbListcan be replaced byListandPbMapcan be replaced byMap.For immutable lists and maps, you can use
built_value. (#1072) -
Map fields now check key and value validity when adding elements. (#1065, #1076)
-
-
5.1.006 Nov 2025Release notes
Open source →-
Update default size limit of
CodedBufferReaderfrom 67,108,864 bytes to 2,147,483,647 bytes, and default recursion limit from 64 to 100.The new limits are consistent with the Java and C++ implementations. (#1060)
-
Fix
GeneratedMessage.addExtensionreturning non-frozen andGeneratedMessage.getExtensionallowing modifying an extension when the message is frozen before initializing the extension field set. (#1062) -
Fix
GeneratedMessage.getExtensionreturning differently typed lists when the message extension field set is initialized and frozen and initialized but not frozen. (#1062) -
Fix
PbListmethodsaddAll,insertAll,replaceRange,setAll,setRangeiterating theIterableargument twice. (#730, #1070) -
Fix
GeneratedMessage.==throwing a type error when comparingmapfields in some cases. (#1075, #1077)This bug was introduced with protobuf-5.0.0.
Release notes
Open source →-
Update default size limit of
CodedBufferReaderfrom 67,108,864 bytes to 2,147,483,647 bytes, and default recursion limit from 64 to 100.The new limits are consistent with the Java and C++ implementations. (#1060)
-
Fix
GeneratedMessage.addExtensionreturning non-frozen andGeneratedMessage.getExtensionallowing modifying an extension when the message is frozen before initializing the extension field set. (#1062) -
Fix
GeneratedMessage.getExtensionreturning differently typed lists when the message extension field set is initialized and frozen and initialized but not frozen. (#1062) -
Fix
PbListmethodsaddAll,insertAll,replaceRange,setAll,setRangeiterating theIterableargument twice. (#730, #1070) -
Fix
GeneratedMessage.==throwing a type error when comparingmapfields in some cases. (#1075, #1077)This bug was introduced with protobuf-5.0.0.
-
-
5.0.030 Sep 2025Release notes
Open source →- Improve performance of
GeneratedMessage.deepCopy. (#742) - Fix unknown enum handling in
GeneratedMessage.mergeFromProto3Jsonwhen theignoreUnknownFieldsoptional argument istrue. (#853) - Add
BuilderInfomethods to support protoc-plugin 23.0.0. (#1047) - Generalize argument type of
PbList.fromfromList<T>toIterable<T>. (#1054) - Fix clearing oneof fields with
GeneratedMessage.clear. (#1057) - Fix unknown JSON handling when using
GeneratedMessagemethodsmergeFromJson,mergeFromJsonMap,writeToJson,writeToJsonMap. (#1058)
Release notes
Open source →- Improve performance of
GeneratedMessage.deepCopy. (#742) - Fix unknown enum handling in
GeneratedMessage.mergeFromProto3Jsonwhen theignoreUnknownFieldsoptional argument istrue. (#853) - Add
BuilderInfomethods to support protoc-plugin 23.0.0. (#1047) - Generalize argument type of
PbList.fromfromList<T>toIterable<T>. (#1054) - Fix clearing oneof fields with
GeneratedMessage.clear. (#1057) - Fix unknown JSON handling when using
GeneratedMessagemethodsmergeFromJson,mergeFromJsonMap,writeToJson,writeToJsonMap. (#1058)
- Improve performance of
-
4.2.012 Aug 2025Release notes
Open source →-
Internal refactoring to split the package into libraries. This allows conditionally importing different libraries and improving performance by using different encoding/decoding libraries based on the target platform. (#1026)
-
Some of the private
PbFieldTypemembers are made public, to allow using them in internal libraries. This type is for internal use only. (#1027) -
Improve performance of
GeneratedMessagemembers:writeToJsonMap,writeToJson,mergeFromJson,mergeFromJsonMap. (#1028) -
Remove
BuilderInfo.fromProto3JsonandBuilderInfo.toProto3Jsonas a part of an internal refactoring.
-
-
4.1.116 Jul 2025Release notes
Open source → -
4.1.019 May 2025 -
4.0.028 Mar 2025Release notes
Open source →-
Breaking: The following types and members are now removed:
PbEventMixinPbFieldChangeEventBufferGeneratedMessage.createRepeatedFieldGeneratedMessage.createMapField
These were used to implement events, which are unused internally. To keep API surface small (to make it easier to change the library or migrate to another library) these types and members are removed. (#738)
-
Breaking:
CodedBufferWriter.writeRawBytesnow takes aUint8Listargument (instead ofTypedData). -
GeneratedMessageGenericExtensions.deepCopyis now annotated with@useResultand will generate a warning when its result is not used. (#896) -
Breaking:
PbMap.unmodifiablenow takes key and value field types as arguments, instead of anotherPbMap.To migrate, use
PbMap.unmodifiable(map.keyFieldType, map.valueFieldType)instead ofPbMap.unmodifiable(map). (#902) -
Messages deserialized from JSON now generate the unknown fields when serialized as JSON.
Note that, as before, unknown fields in JSON messages are not stored in the
unknownFieldsof the message. They are only used by the JSON serializers to support roundtripping. -
Minimum SDK dependency bumped from 2.19.0 to 3.3.0. (#953)
-
-
3.1.014 Aug 2023 -
3.0.015 Jun 2023Release notes
Open source →- Require Dart
2.19. - Remove
ReadonlyMessageMixin(#183, #644) - Remove
frozenMessageModificationHandler(#175, #643) - Remove
PbListBaseandFrozenPbListtypes. All proto repeated fields now usePbList. To check if a list is frozen, useisFrozengetter. (#624, #626) - Initialize map fields in
GeneratedMessage.getField. This behavior is consistent withgetFieldcalled on repeated fields. (#373, #707) - Remove unused and optional
PbMapconstructor argumentBuilderInfo? info. (d94d3f0) UnknownFieldSetFieldmethodshasRequiredFields,isInitializedand getterlengthremoved. (#721)- Update library documentation to hide internals, add documentation for public types. (#681)
- Fix
PbMap._isReadonlyfield initialization inPbMap.unmodifiable. (#741, #754) - Fix decoding map fields when key or value (or both) fields of a map entry is missing. (#719, #745)
- Fix updating frozen (immutable) messages with merge methods
(
mergeFromBuffer,mergeFromProto3Json, ...). (#489, #727) - Fix handling
nullvalues in proto3 JSON deserializer. (#751, #760, #763) - Fix handling negative JSON values when parsing uint32 fields. (#839)
- Avoid serializing unknown fields twice in
reparseMessage. (#840)
- Require Dart
-
2.1.015 Jun 2022Release notes
Open source →- Update READMEs of
protobufandprotoc_plugin: - Update some of the documentation according to Effective Dart documentation guide (#664, #674)
- Improve runtime perf by removing some of the runtime type checks (#574, #573)
- Fix a bug when converting negative
Timestampto DartDateTime(#580, #577) - Document
BuilderInfoandFieldInfoproperties (#597) - Improve
BuilderInfoinitialization by doing some of the work lazily (#606) - Improve enum hash code generation (#556)
- Fix parsing nested
Anymessages from JSON (#568) - Improve message hash code generation performance (#554, #633)
- Fix reading uninitialized map fields changing equality and hash code of messages. (#638)
- Fix setting an extension field when there's an unknown field with the same tag. (#639)
- Fix sharing backing memory for
repeated bytesandoptional bytesfields. (#640) GeneratedMessage.rebuildnow generates a warning when the return value is not used. (#631)- Fix hash code of messages with empty unknown field set (#648)
- Show field tags with
protobuf.omit_field_names, enum value tags withprotobuf.omit_enum_namesin debug strings (toStringmethods) (#649) TimestampMixin.toDateTimenow takes an optional namedboolargumenttoLocal(defaults tofalse) for generating aDateTimein the local time zone (instead of UTC). (#653)- Fix serialization of
infinityandnandoubles in JSON serializers (#652) - Fix Dart generation for fields starting with underscore (#651)
- Fix proto3 JSON deserialization of fixed32 fields (#655)
- Fix uninitialized repeated field values runtime types for frozen messages (#654)
- Update READMEs of
-
2.0.102 Dec 2021Release notes
Open source →- Fix bug of parsing map-values with default values.
- Merge fixes from version
1.1.2-1.1.4into v2.
-
2.0.011 Feb 2021 -
2.0.0-nullsafety.107 Jan 2021 pre-releaseNothing published for this version
-
2.0.0-nullsafety.013 Nov 2020 pre-releaseNothing published for this version
-
1.1.421 Jun 2021Release notes
Open source →- Fix comparison of empty lists from frozen messages.
- Switch repo internals to use
dart formatinstead ofdartfmt.
-
1.1.326 Feb 2021 -
1.1.223 Feb 2021Release notes
Open source →- Fix proto deserialization issue for repeated and map enum value fields where the enum value is unknown.
-
1.1.104 Feb 2021Release notes
Open source →- Fix decoding of
oneoffields from proto3 json. The 'whichFoo' state would not be set. - Fix the return type of
copyWith.
- Fix decoding of
-
1.1.028 Oct 2020Release notes
Open source →- Require at least Dart SDK 2.7.0 to enable usage of extension methods.
- Introduce extension methods
GeneratedMessage.rebuildandGeneratedMessage.deepCopyreplacingcopyWithandclone. Using these alternatives can result in smaller binaries, because it is defined once instead of once per class. Useprotoc_pluginfrom 19.1.0 to generate deprecation warnings forcopyWithandclonemethods. GeneratedMessage.getExtensionthrows when reading trying to read an extension that is present in the unknown fields. We consider this change a bug-fix because depending on the old behavior is indicative of a bug in your program.
-
1.0.111 Nov 2019Release notes
Open source →- Fix issue with
ExtensionRegistry.reparseMessagenot handling map fields with scalar value types correctly. - Fix issue with the non-json name of a field (
protoName) not being set correctly. - Fix: Allow decoding tagnumbers of unknown fields of up to 29 bits.
- Fix issue with
-
1.0.030 Sep 2019 -
0.14.426 Sep 2019Release notes
Open source →- Add
permissiveEnumsoption tomergeFromProto3Json. It will do a case-insensitive matching of enum values ignoring-and_. - Add support for 'ensureX' methods generated by
protoc_plugin19.0.0. - Add specialized getters for
String,int, andboolwith usual default values. - Shrink dart2js generated code for
getDefault(). - Added an annotation class
TagNumber. This is used by code generated byprotoc_pluginfrom version 19.0.0.
- Add
-
0.14.317 Sep 2019Release notes
Open source →- Fix: Allow decoding tagnumbers of up to 29 bits. Would fail before with more than 28 bits.
-
0.14.106 Sep 2019Release notes
Open source →-
Support for
import public.The generated code for a protofile
a.protothatimport public "b.proto"will export the generated code forb.proto.See https://developers.google.com/protocol-buffers/docs/proto#importing-definitions.
-
-
0.14.006 Sep 2019Release notes
Open source →-
Support for proto3 json (json with field names as keys)
- encoding and decoding.
- Support for well-known types.
- Use
GeneratedMessage.toProto3Json()to encode andGeneratedMessage.mergeFromProto3Json(json)to decode.
-
FieldInfoobjects have a new getter.protoNamethat gives the non-camel-case name of the field as in the.proto-file. -
Breaking: The field-adder methods on
BuilderInfonow takes only named optional arguments. To migrate, updateprotoc_pluginto version 18.0.0 or higher. -
The field-adder methods on
BuilderInfoall take a new argumentprotoName. -
Breaking: Changed
ExtensionRegistry.reparseMessageto reparse extensions deeply, that is it looks at every nested message and tries to reparse extensions from its unknown fields.
-
-
0.13.1612 Sep 2019Release notes
Open source →- Better handling of dummy calls to
BuilderInfo.addwith a tag number of 0. These would trigger assertions before.
- Better handling of dummy calls to
-
0.13.16+112 Sep 2019Release notes
Open source →- Reverts
0.13.16which accidentally introduced a breaking change, #284. This release is identical to0.13.15.
- Reverts
-
0.13.1510 Jul 2019Release notes
Open source →- Add new getter
GeneratedMessage.isFrozento query if the message has been frozen.
- Add new getter
-
0.13.1409 Jul 2019 -
0.13.1204 Jun 2019Release notes
Open source →BuilderInfo.addnow ignores fields with tag number 0. These would never be generated by the protoc_plugin so this is not considered a breaking change.
-
0.13.1111 Apr 2019Release notes
Open source →- Save memory by only initializing
_FieldSet.oneofCasesif the message contains oneofs.
- Save memory by only initializing
-
0.13.905 Apr 2019Release notes
Open source →- Move 'eventPlugin' callback when setting a field in order to notify observers about field updates in the correct order.
-
0.13.803 Apr 2019 -
0.13.601 Apr 2019 -
0.13.425 Feb 2019Release notes
Open source →-
Add new method
pcon BuilderInfo for adding repeated composite fields and remove redundant type check on items added to a PbList.Deprecated
BuilderInfo.ppandPbList.forFieldType.
-
-
0.13.312 Feb 2019Release notes
Open source →-
Fix issue with parsing map field entries. The values for two different keys would sometimes be merged.
-
Deprecated
PBMap.add.
-
-
0.13.205 Feb 2019 -
0.13.104 Feb 2019Release notes
Open source →- Fix issue with not being able to read unknown fields after freezing.
Reading an unknown field set after freeze() now returns the existing field set before freezing instead of an empty UnknownFieldSet.
-
0.13.022 Jan 2019Release notes
Open source →- Breaking change: Fix issue with not being able to read extensions after freezing.
Reading an extension field after freeze() now returns the value set before freezing instead of the default value.
-
0.12.015 Jan 2019Release notes
Open source →-
Breaking change: Changed
BuilderInfo.m()to take class and package name of the protobuf message representing the map entry. Also changedBuilderInfo.addMapFieldas well as the constructorsPbMapandMapFieldInfo.mapto take a map entry BuilderInfo object.This mostly affects generated code, which should now be built with protoc_plugin 15.0.0 or newer.
With this change we avoid creating a map entry BuilderInfo object for each PbMap instance, instead it is passed through the static BuilderInfo object in the generated subclasses of GeneratedMessage.
-
-
0.11.008 Jan 2019Release notes
Open source →-
Breaking change: changed semantics of
GeneratedMessage.toBuilder()to only make a shallow copy.GeneratedMessagehas a new abstract method:createEmptyInstance()that subclasses must implement.Proto files must be rebuilt using protoc_plugin 14.0.0 or newer.
-
-
0.10.808 Jan 2019 -
0.10.708 Jan 2019 -
0.10.602 Jan 2019Release notes
Open source →- Added support for oneof. To use oneof support use Dart protoc_plugin version 13.0.0.
-
0.10.527 Nov 2018Release notes
Open source →- Added support for map fields. Map fields are now represented as Dart maps and are accessed through a getter with the same name as the map field. To use the map support, use Dart protoc_plugin version 11.0.0 or newer.
-
0.10.402 Oct 2018 -
0.10.321 Sep 2018Release notes
Open source →- Added type argument to
ProtobufEnum.initByValuewhich allows the return value to be fully typed.
- Added type argument to
-
0.10.206 Sep 2018 -
0.10.130 Aug 2018 -
0.10.030 Aug 2018Release notes
Open source →- Breaking change: Add
GeneratedMessage.freeze(). A frozen message and its sub-messages cannot be changed.
- Breaking change: Add
-
0.9.108 Aug 2018Release notes
Open source →- Fix problem with encoding negative enum values.
- Fix problem with encoding byte arrays.
-
0.9.025 May 2018Release notes
Open source →- Breaking change: Changed signature of
CodedBufferWriter.writeToto requireUint8Listfor performance. - More Dart 2 fixes.
- Breaking change: Changed signature of
-
0.9.0+118 Jul 2018Release notes
Open source →- Dart SDK upper constraint raised to declare compatibility with Dart 2.0 stable.
-
0.8.017 May 2018Release notes
Open source →- Breaking change: Added generics to RpcClient.invoke(). Proto files must be rebuilt using Dart protoc_plugin version 0.8.0 or newer to match.
- Dart 2 fixes.
-
0.7.209 Apr 2018 -
0.7.122 Feb 2018 -
0.7.012 Jan 2018Release notes
Open source →- Added fast getters for common types.
- Only pass index instead of both tag and index to accessors.
- Delegate more methods to underlying list in PbList.
- Small fixes for Dart 2.0.
-
0.6.025 Oct 2017Release notes
Open source →- Added enumValues to FieldInfo. Fixes #63.
- Small performance optimization when deserializing repeated messages from JSON.
- Type annotations for strong mode.
-
0.5.514 Aug 2017 -
0.5.420 Apr 2017Release notes
Open source →- Unknown enum values are ignored when parsing JSON, instead of throwing an exception.