weatherConditionV2NullableFromJson function

WeatherConditionV2? weatherConditionV2NullableFromJson(
  1. Object? weatherConditionV2, [
  2. WeatherConditionV2? defaultValue
])

Implementation

enums.WeatherConditionV2? weatherConditionV2NullableFromJson(
  Object? weatherConditionV2, [
  enums.WeatherConditionV2? defaultValue,
]) {
  if (weatherConditionV2 == null) {
    return null;
  }
  return enums.WeatherConditionV2.values
          .firstWhereOrNull((e) => e.value == weatherConditionV2) ??
      defaultValue;
}