findAttribute method

CustomAttribute findAttribute(
  1. String name
)

Finds the first CustomAttribute with the specified name.

Throws a WinmdException if no matching attribute is found.

Implementation

CustomAttribute findAttribute(String name) =>
    attributes.where((attr) => attr.name == name).firstOrNull ??
    (throw WinmdException('Attribute not found: $name'));