Document map key and value fields (#603)
diff --git a/protobuf/lib/src/protobuf/field_info.dart b/protobuf/lib/src/protobuf/field_info.dart index a825f6a..2d668cf 100644 --- a/protobuf/lib/src/protobuf/field_info.dart +++ b/protobuf/lib/src/protobuf/field_info.dart
@@ -221,7 +221,16 @@ } class MapFieldInfo<K, V> extends FieldInfo<PbMap<K, V>?> { + /// Key type of the map. Per proto2 and proto3 specs, this needs to be an + /// integer type or `string`, and the type cannot be `repeated`. + /// + /// The `int` value is interpreted the same way as [FieldInfo.type]. final int? keyFieldType; + + /// Value type of the map. Per proto2 and proto3 specs, this can be any type + /// other than `map`, and the type cannot be `repeated`. + /// + /// The `int` value is interpreted the same way as [FieldInfo.type]. final int? valueFieldType; /// Creates a new empty instance of the value type.
diff --git a/protobuf/lib/src/protobuf/pb_map.dart b/protobuf/lib/src/protobuf/pb_map.dart index 5c2c28c..7449856 100644 --- a/protobuf/lib/src/protobuf/pb_map.dart +++ b/protobuf/lib/src/protobuf/pb_map.dart
@@ -5,7 +5,16 @@ part of protobuf; class PbMap<K, V> extends MapBase<K, V> { + /// Key type of the map. Per proto2 and proto3 specs, this needs to be an + /// integer type or `string`, and the type cannot be `repeated`. + /// + /// The `int` value is interpreted the same way as [FieldInfo.type]. final int? keyFieldType; + + /// Value type of the map. Per proto2 and proto3 specs, this can be any type + /// other than `map`, and the type cannot be `repeated`. + /// + /// The `int` value is interpreted the same way as [FieldInfo.type]. final int? valueFieldType; static const int _keyFieldNumber = 1;