readEnum<T extends Enum> method
Reads an enumeration value from the source. If not found or in case of an
error, it returns the provided defaultValue
.
Implementation
T readEnum<T extends Enum>(source, key, List<T> values, T defaultValue) {
return tryReadEnum<T>(source, key, values) ?? defaultValue;
}