requestFromResource function
Implementation
interop.Request requestFromResource(Resource resource) {
switch (resource.runtimeType) {
case StringValue:
return interop.Request((resource as StringValue).url);
case UriValue:
return interop.Request((resource as UriValue).uri.toString());
case RequestValue:
return (resource as RequestValue).request.delegate;
default:
throw Exception('Unknown resource type ${resource.runtimeType}');
}
}