fromURI static method
Constructor with Resource
from uri
.
content
in case of content/body is already resolved.
Implementation
static ResourceContent? fromURI(Object? uri, [String? content]) {
if (uri == null && content == null) return null;
if (uri is Uri) {
return ResourceContent(Resource(uri), content);
} else if (uri is String) {
return ResourceContent(Resource(uri), content);
} else if (uri is ResourceContent) {
return ResourceContent(Resource(uri.uri), content);
} else {
var url = uri.toString();
return ResourceContent(Resource(url), content);
}
}