writeAttributes static method
Writes attributes as key="value": true as the bare key,
false and null not at all, values escaped.
Implementation
static void writeAttributes(StringSink out, Map<String, Object?> attributes) {
for (final MapEntry(:key, :value) in attributes.entries) {
switch (value) {
case null || false:
break;
case true:
out.write(' $key');
default:
out.write(' $key="${escapeHtml('$value')}"');
}
}
}