withUri static method
- Uri uri
Creates a portal item from the specified portal item URL.
Use this object to create a portal item from a URL. The supported URL formats are:
- The REST Sharing API URL of the portal item (with or without the query parameter f=json). Example: https://www.arcgis.com/sharing/rest/content/items/c6a2c53ead68432586cc9ac9ec366055?f=json
- The REST Sharing API URL of the portal item data. Example: https://www.arcgis.com/sharing/rest/content/items/c6a2c53ead68432586cc9ac9ec366055/data
- The URL of the portal item details web page. Example: https://www.arcgis.com/home/item.html?id=c6a2c53ead68432586cc9ac9ec366055
- The URL of a web map opened in the portal's map viewer web application (classic or new). Example: https://www.arcgis.com/home/webmap/viewer.html?webmap=8bf7167d20924cbf8e25e7b11c7c502c or https://www.arcgis.com/apps/mapviewer/index.html?webmap=8bf7167d20924cbf8e25e7b11c7c502c
- The URL of a web scene opened in the portal's scene viewer web application. Example: https://www.arcgis.com/home/webscene/viewer.html?webscene=74ec7d6ca482442ba24f80b708aec67e
Parameters:
uri
— The URL to the portal item.
Implementation
static PortalItem? withUri(Uri uri) {
_initializeArcGISEnvironmentIfNeeded();
final coreURI = _CString(uri.toString());
final handle = _withThrowingErrorHandler((errorHandler) {
return runtimecore.RT_PortalItem_createWithURL(
coreURI.bytes, errorHandler);
});
if (handle == ffi.nullptr) return null;
return Item._instanceCache.instanceWith(handle);
}