putValue method

RudderTraits putValue(
  1. Map<String, dynamic> map
)

Adds multiple key-value pairs to the traits extras.

This method allows adding multiple custom traits at once. The 'extras' key is reserved and will be ignored if present in the map with a warning logged.

map - A map of key-value pairs to add to the traits. Returns this RudderTraits instance for method chaining.

Implementation

RudderTraits putValue(Map<String, dynamic> map) {
  if (map.remove("extras") != null) {
    RudderLogger.logError(
        "extras is a reserved key, hence it will be ignored. Please use any other key instead.");
  }

  Map<String, dynamic> extras =
      __traitsMap.putIfAbsent("extras", () => <String, dynamic>{});
  extras.addAll(map);
  return this;
}