copyWithWrapped method

HomeDTO copyWithWrapped({
  1. Wrapped<int?>? id,
  2. Wrapped<String?>? name,
  3. Wrapped<WeatherConditionDTO?>? weatherCondition,
  4. Wrapped<double?>? weatherTempF,
  5. Wrapped<WeatherTimePeriodDTO?>? weatherTimePeriod,
  6. Wrapped<AddressDTO?>? address,
  7. Wrapped<List<DeviceDTO>?>? devices,
  8. Wrapped<List<HomeUserDTO>?>? users,
})

Implementation

HomeDTO copyWithWrapped(
    {Wrapped<int?>? id,
    Wrapped<String?>? name,
    Wrapped<enums.WeatherConditionDTO?>? weatherCondition,
    Wrapped<double?>? weatherTempF,
    Wrapped<enums.WeatherTimePeriodDTO?>? weatherTimePeriod,
    Wrapped<AddressDTO?>? address,
    Wrapped<List<DeviceDTO>?>? devices,
    Wrapped<List<HomeUserDTO>?>? users}) {
  return HomeDTO(
      id: (id != null ? id.value : this.id),
      name: (name != null ? name.value : this.name),
      weatherCondition: (weatherCondition != null
          ? weatherCondition.value
          : this.weatherCondition),
      weatherTempF:
          (weatherTempF != null ? weatherTempF.value : this.weatherTempF),
      weatherTimePeriod: (weatherTimePeriod != null
          ? weatherTimePeriod.value
          : this.weatherTimePeriod),
      address: (address != null ? address.value : this.address),
      devices: (devices != null ? devices.value : this.devices),
      users: (users != null ? users.value : this.users));
}