bool hasAttribute(String name)

Checks if this node has the specified attribute.

Source

bool hasAttribute(String name) => attributes.containsKey(
    name.startsWith("@") ? name : '@' + name
);