encodeTo method
Convert self to a slice and append it to the destination.
Implementation
@override
void encodeTo(MapEntry<String, V> value, Output output) {
final type = value.key;
final index = map.inverse[type];
if (index == null) {
throw EnumException(
'Invalid enum value: $value. Can only accept: ${map.values.join(', ')}');
}
output.pushByte(index);
final codec = registry.getCodec(type);
assertion(codec != null, 'Codec for type:$type not found.');
codec!.encodeTo(value.value, output);
}