fromEnum static method
Returns name of given enum value
.
If given value
is empty or not enum, null is returned.
Implementation
static String? fromEnum(dynamic value) {
if (value == null) {
return null;
}
final data = value.toString().split('.');
if (data.length == 2) {
return data[1];
}
return null;
}