protobufTreeEncode method

  1. @override
Object protobufTreeEncode(
  1. Map<K, V> value, {
  2. ProtobufEncodingContext? context,
})
override

Converts the argument into a Protocol Buffers tree.

The output graph can contain instances of the following types:

  • null
  • bool
  • int
  • Int64 (package:fixnum)
  • double
  • String
  • Uint8List
  • GeneratedMessage (package:protobuf)
    • Field values must be instances of allowed types.
  • List
    • Items must be instances of single non-list allowed type.

The output graph must be a tree (no cycles are allowed).

The method must serialize other values with context, which may be constructed by the method if it's null.

Example

StringKind().protobufTreeEncode('abc');
// --> 'abc'

SomeEntity.kind.protobufTreeEncode(instanceOfSomeEntity);
// --> GeneratedMessage (package:protobuf)

Implementation

@override
Object protobufTreeEncode(Map<K, V> value,
    {ProtobufEncodingContext? context}) {
  throw UnimplementedError();
}