setOnce method Null safety
- String prop,
- dynamic to
Works just like set(), except it will not overwrite existing property values. This is useful for properties like "First login date".
propThe name of the Mixpanel property. This must be a String, for example "Zip Code"toThe value of the Mixpanel property. For "Zip Code", this value might be the String "90210"
Implementation
void setOnce(String prop, dynamic to) {
if (_MixpanelHelper.isValidString(prop)) {
Map<String, dynamic> properties = {prop: to};
_channel.invokeMethod<void>('setOnce',
<String, dynamic>{'token': this._token, 'properties': properties});
} else {
developer.log('`people setOnce` failed: prop cannot be blank',
name: 'Mixpanel');
}
}