You can create properties objects to add additional information to events. You can then use this extra information to further break down the event.

Create Properties

Smartlook APIs provide user and event Properties singletons. To create other Properties for track events, use the default constructor:

final Properties properties = Properties();

Put property

You can add properties using the putString() method. Every property is defined by a name and value:

properties.putString('sample_key', value: 'sample_value');

🚧

Name restrictions

  • Cannot be empty or null.
  • Maximum length is PROPERTY_NAME_MAX_LENGTH.
  • Can only contain alphanumeric characters, underscore (_), comma (,), period (.), and hyphen (-).
  • Must start with an alphabetic character.

🚧

Value restrictions

  • The maximum length is PROPERTY_VALUE_MAX_LENGTH.

Get property

You can read any property using the getString() method. If a property with the name exists, then the value is returned. Otherwise, null is returned:

final String? sampleValue = properties.getString('sample_key');

Remove property

You can remove any property using the remove() method, or by setting it to null:

properties.remove('sample_key');
properties.putString('sample_key', null);

Clear properties

You can clear all properties using clear():

properties.clear();