Strange and unexpected behavior of the constructor of an enum in Dart

Viewed 35

I’m writing a code with a enum.

You can run the code here in a DartPad.

The enum constructor has a optional named parameter codeAndDescription. An enumeration value does not specify the value of parameter codeAndDescription (which by default should be an empty string). If I print this value, it does not print an empty string, but 'null'. Does anyone know if this is a bug or if I’m wrong?

Thank you very much!

1 Answers
Related