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