powerSourceDTONullableFromJson function
- Object? powerSourceDTO, [
- PowerSourceDTO? defaultValue
Implementation
enums.PowerSourceDTO? powerSourceDTONullableFromJson(
Object? powerSourceDTO, [
enums.PowerSourceDTO? defaultValue,
]) {
if (powerSourceDTO == null) {
return null;
}
return enums.PowerSourceDTO.values
.firstWhereOrNull((e) => e.value == powerSourceDTO) ??
defaultValue;
}