getAttributesSignature method

String getAttributesSignature()

Returns a deterministic String of all attributes entries.

Implementation

String getAttributesSignature() {
  final attributes = _attributes;
  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');
}