copyWith method
Implementation
ContactValue<T> copyWith({
T? type,
String? description,
String? value,
(String, bool)? isFieldValid,
}) {
return ContactValue._(
key: key,
type: type ?? this.type,
description: description ?? this.description,
value: value ?? this.value,
// if isFieldValid is not null, update the validFields map
validFields: isFieldValid != null
? {
...validFields,
isFieldValid.$1: isFieldValid.$2,
}
: validFields,
);
}