encodeValue method

  1. @override
Uint8List encodeValue(
  1. Map x
)
override

Encode the value. This needs to be public because it is used by encodeValue() from different types. @internal

Implementation

@override
Uint8List encodeValue(Map x) {
  final values = _fields.map((entry) => x[entry.key]).toList();

  final bufs =
      zipWith<MapEntry, dynamic, Uint8List>(_fields, values, (entry, d) {
    var t = entry.value;
    return tryToJson(t, d) ?? t.encodeValue(d);
  });
  return u8aConcat(bufs);
}