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 buffer = zipWith<MapEntry, dynamic, Uint8List>(
    _fields,
    values,
    (entry, d) {
      final t = entry.value;
      return tryToJson(t, d) ?? t.encodeValue(d);
    },
  );
  return u8aConcat(buffer);
}