toString method Null safety

  1. @override
String toString()
override

Returns this enum's name or the value if names are not represented.

Implementation

@override
String toString() => name == '' ? value.toString() : name;