Google is committed to advancing racial equity for Black communities. See how.

encode method

  • @override

void encode (Encoder encoder, T value, int offset, int depth)

override

Implementation

@override
void encode(Encoder encoder, T? value, int offset, int depth) {
  if (value == null) {
    encoder.encodeUint64(kAllocAbsent, offset);
  } else {
    encoder.encodeUint64(kAllocPresent, offset);
    int childOffset =
        encoder.alloc(element.inlineSize(encoder.wireFormat), depth);
    element.encode(encoder, value, childOffset, depth + 1);
  }
}