getEnum method
Implementation
dynamic getEnum(
{required List<dynamic> values,
required dynamic data,
dynamic defaultValue}) {
if (data == null) {
return defaultValue;
}
if (data is Enum) {
return data;
}
for (dynamic value in values) {
if (value.toString().split('.').last == data) {
return value;
}
}
return defaultValue;
}