protobufTreeDecode abstract method

T protobufTreeDecode(
  1. Object? value, {
  2. ProtobufDecodingContext? context,
})

Converts the argument (a Protocol Buffers tree) into an instance of T.

The input graph contains 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 graph must be a tree (no cycles are allowed).

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

Example

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

// We assume `generatedMessage` is an instance of GeneratedMessage
// (package:protobuf)
SomeEntity.kind.protobufTreeDecode(generatedMessage);
// --> instance of SomeEntity

Implementation

T protobufTreeDecode(Object? value, {ProtobufDecodingContext? context});