copyWithStringAttribute method

Attributes copyWithStringAttribute(
  1. String name,
  2. String value
)

Creates a new Attributes instance with a String attribute added or updated.

@param name The attribute key @param value The String value @return A new Attributes instance with the added/updated attribute

Implementation

Attributes copyWithStringAttribute(String name, String value) {
  return AttributesCreate.create([
    ..._entries.values,
    AttributeCreate.create<String>(name, value),
  ]);
}