getTargetInterfaceElement method

InterfaceElement? getTargetInterfaceElement(
  1. Expression target
)
inherited

Returns the class element associated with the target, or null if there is no such element.

Implementation

InterfaceElement? getTargetInterfaceElement(Expression target) {
  var type = target.staticType;
  if (type is InterfaceType) {
    return type.element;
  } else if (target is Identifier) {
    var element = target.element;
    if (element is InterfaceElement) {
      return element;
    }
  }
  return null;
}