weatherTimePeriodDTONullableFromJson function

WeatherTimePeriodDTO? weatherTimePeriodDTONullableFromJson(
  1. Object? weatherTimePeriodDTO, [
  2. WeatherTimePeriodDTO? defaultValue
])

Implementation

enums.WeatherTimePeriodDTO? weatherTimePeriodDTONullableFromJson(
  Object? weatherTimePeriodDTO, [
  enums.WeatherTimePeriodDTO? defaultValue,
]) {
  if (weatherTimePeriodDTO == null) {
    return null;
  }
  return enums.WeatherTimePeriodDTO.values
          .firstWhereOrNull((e) => e.value == weatherTimePeriodDTO) ??
      defaultValue;
}