powerSourceV2NullableFromJson function

PowerSourceV2? powerSourceV2NullableFromJson(
  1. Object? powerSourceV2, [
  2. 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;
}