encodeTo method
Convert self to a slice and append it to the destination.
Implementation
@override
void encodeTo(A value, Output output) {
final index = map.inverse[value];
if (index == null) {
throw EnumException('Invalid enum index: $index.');
}
return output.pushByte(index);
}