getAttributesSignature method

String getAttributesSignature()

Returns a deterministic String of all attributes entries.

Implementation

String getAttributesSignature() {
  if (_attributes == null || _attributes!.isEmpty) return '';
  var entries = _attributes!
      .map((key, value) => MapEntry(key.toLowerCase(), value.value))
      .entries
      .toList();
  entries.sort((a, b) => a.key.compareTo(b.key));
  var attributesSignature =
      entries.map((e) => '${e.key}=${e.value}').toList();
  return attributesSignature.join('\n');
}