getEnum method
Implementation
dynamic getEnum(
{required String key,
required List<dynamic> values,
dynamic defaultValue}) {
dynamic data = _data[key];
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;
}