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