setField method
void
setField({
- required int index,
- required ContactInfoFieldType type,
- required String value,
- required String name,
Sets or updates a contact field at index.
If index is negative the call does nothing. If index is within the
current range the field is updated; when index is beyond the current
field count a new field is appended (behavior mirrors the native API).
Parameters
index: Index of the field to set or update.type: The field type to store.value: The field value to store.name: Display name for the field.
Implementation
void setField({
required final int index,
required final ContactInfoFieldType type,
required final String value,
required final String name,
}) {
if (index < 0) {
return;
}
if (index < fieldsCount) {
objectMethod(
pointerId,
'ContactInfo',
'setField',
args: <String, dynamic>{
'index': index,
'type': type.id,
'value': value,
'name': name,
},
);
} else {
addField(type: type, value: value, name: name);
}
}