copyWith method
AddressValue<T>
copyWith(
{ - T? type,
- String? description,
- String? number,
- String? street,
- String? other,
- String? municipality,
- String? county,
- String? province,
- String? postalCode,
- String? countryCode,
- (String, bool)? isFieldValid,
})
Implementation
AddressValue<T> copyWith({
T? type,
String? description,
String? number,
String? street,
String? other,
String? municipality,
String? county,
String? province,
String? postalCode,
String? countryCode,
(String, bool)? isFieldValid,
}) {
return AddressValue._(
key: key,
type: type ?? this.type,
description: description ?? this.description,
number: number ?? this.number,
street: street ?? this.street,
other: other ?? this.other,
municipality: municipality ?? this.municipality,
county: county ?? this.county,
province: province ?? this.province,
postalCode: postalCode ?? this.postalCode,
countryCode: countryCode ?? this.countryCode,
// if isFieldValid is not null, update the validFields map
validFields: isFieldValid != null
? {
...validFields,
isFieldValid.$1: isFieldValid.$2,
}
: validFields,
);
}