updateHumanNameSuffix method
Implementation
RelatedPerson updateHumanNameSuffix(List<String> suffix, [int index = 0]) {
if (name == null || name!.isEmpty) {
return copyWith(name: <HumanName>[HumanName(suffix: suffix)]);
} else if (index >= name!.length) {
return copyWith(name: <HumanName>[...name!, HumanName(suffix: suffix)]);
} else {
return copyWith(name: <HumanName>[
...name!.sublist(0, index),
name![index].copyWith(suffix: suffix),
...name!.sublist(index + 1)
]);
}
}