updateContactPointValue method
Implementation
FhirEndpoint updateContactPointValue(String value, [int index = 0]) {
if (contact == null || contact!.isEmpty) {
return copyWith(contact: <ContactPoint>[ContactPoint(value: value)]);
} else if (index >= contact!.length) {
return copyWith(
contact: <ContactPoint>[...contact!, ContactPoint(value: value)]);
} else {
return copyWith(contact: <ContactPoint>[
...contact!.sublist(0, index),
contact![index].copyWith(value: value),
...contact!.sublist(index + 1)
]);
}
}