assetIdForElement method

Future<AssetId> assetIdForElement (Element element)

Returns the AssetId of the Dart library or part declaring element.

If element is defined in the SDK or in a summary throws UnresolvableAssetException, although a non-throwing return here does not guarantee that the asset is readable.

The returned asset is not necessarily the asset that should be imported to use the element, it may be a part file instead of the library.

Implementation

Future<AssetId> assetIdForElement(Element element);