isAssignableFrom method Null safety

bool isAssignableFrom(
  1. Element element
)

Returns true if the type of element can be assigned to this type.

Implementation

bool isAssignableFrom(Element element) =>
    isExactly(element) ||
    (element is ClassElement && element.allSupertypes.any(isExactlyType));