attributeOf<A extends SpecAttribute> method

A? attributeOf<A extends SpecAttribute>()

Finds and returns an VisualAttribute of type A, or null if not found.

Implementation

A? attributeOf<A extends SpecAttribute>() {
  final attributes = _attributes.whereType<A>();
  if (attributes.isEmpty) return null;

  return _mergeAttributes(attributes) ?? attributes.last;
}