copyWith method

Address copyWith({
  1. List<AddressAdmDiv>? drillDown,
  2. List<AddressComponent>? components,
  3. Optional<String?>? buildingName,
  4. Optional<String?>? postCode,
  5. Optional<String?>? buildingCode,
  6. Optional<String?>? fiasCode,
  7. Optional<String?>? addressComment,
})

Implementation

Address copyWith({
  List<AddressAdmDiv>? drillDown,
  List<AddressComponent>? components,
  Optional<String?>? buildingName,
  Optional<String?>? postCode,
  Optional<String?>? buildingCode,
  Optional<String?>? fiasCode,
  Optional<String?>? addressComment
}) {
  return Address(
    drillDown: drillDown ?? this.drillDown,
    components: components ?? this.components,
    buildingName: buildingName != null ? buildingName.value : this.buildingName,
    postCode: postCode != null ? postCode.value : this.postCode,
    buildingCode: buildingCode != null ? buildingCode.value : this.buildingCode,
    fiasCode: fiasCode != null ? fiasCode.value : this.fiasCode,
    addressComment: addressComment != null ? addressComment.value : this.addressComment
  );
}