implementAsBlocking static method
NSURLDownloadDelegate
implementAsBlocking({
- void downloadDidBegin_()?,
- NSURLRequest? download_willSendRequest_redirectResponse_()?,
- bool download_canAuthenticateAgainstProtectionSpace_()?,
- void download_didReceiveAuthenticationChallenge_()?,
- void download_didCancelAuthenticationChallenge_()?,
- bool downloadShouldUseCredentialStorage_()?,
- void download_didReceiveResponse_()?,
- void download_willResumeWithResponse_fromByte_()?,
- void download_didReceiveDataOfLength_()?,
- bool download_shouldDecodeSourceDataOfMIMEType_(
- NSURLDownload,
- NSString
- void download_decideDestinationWithSuggestedFilename_(
- NSURLDownload,
- NSString
- void download_didCreateDestination_(
- NSURLDownload,
- NSString
- void downloadDidFinish_()?,
- void download_didFailWithError_(
- NSURLDownload,
- NSError
- bool $keepIsolateAlive = true,
Builds an object that implements the NSURLDownloadDelegate protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly. All
methods that can be implemented as blocking listeners will be.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSURLDownloadDelegate implementAsBlocking({
void Function(NSURLDownload)? downloadDidBegin_,
NSURLRequest? Function(NSURLDownload, NSURLRequest, NSURLResponse?)?
download_willSendRequest_redirectResponse_,
bool Function(NSURLDownload, NSURLProtectionSpace)?
download_canAuthenticateAgainstProtectionSpace_,
void Function(NSURLDownload, NSURLAuthenticationChallenge)?
download_didReceiveAuthenticationChallenge_,
void Function(NSURLDownload, NSURLAuthenticationChallenge)?
download_didCancelAuthenticationChallenge_,
bool Function(NSURLDownload)? downloadShouldUseCredentialStorage_,
void Function(NSURLDownload, NSURLResponse)? download_didReceiveResponse_,
void Function(NSURLDownload, NSURLResponse, int)?
download_willResumeWithResponse_fromByte_,
void Function(NSURLDownload, DartNSUInteger)?
download_didReceiveDataOfLength_,
bool Function(NSURLDownload, objc.NSString)?
download_shouldDecodeSourceDataOfMIMEType_,
void Function(NSURLDownload, objc.NSString)?
download_decideDestinationWithSuggestedFilename_,
void Function(NSURLDownload, objc.NSString)? download_didCreateDestination_,
void Function(NSURLDownload)? downloadDidFinish_,
void Function(NSURLDownload, objc.NSError)? download_didFailWithError_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSURLDownloadDelegate',
);
NSURLDownloadDelegate.downloadDidBegin_.implementAsBlocking(
builder,
downloadDidBegin_,
);
NSURLDownloadDelegate.download_willSendRequest_redirectResponse_.implement(
builder,
download_willSendRequest_redirectResponse_,
);
NSURLDownloadDelegate.download_canAuthenticateAgainstProtectionSpace_
.implement(builder, download_canAuthenticateAgainstProtectionSpace_);
NSURLDownloadDelegate.download_didReceiveAuthenticationChallenge_
.implementAsBlocking(
builder,
download_didReceiveAuthenticationChallenge_,
);
NSURLDownloadDelegate.download_didCancelAuthenticationChallenge_
.implementAsBlocking(
builder,
download_didCancelAuthenticationChallenge_,
);
NSURLDownloadDelegate.downloadShouldUseCredentialStorage_.implement(
builder,
downloadShouldUseCredentialStorage_,
);
NSURLDownloadDelegate.download_didReceiveResponse_.implementAsBlocking(
builder,
download_didReceiveResponse_,
);
NSURLDownloadDelegate.download_willResumeWithResponse_fromByte_
.implementAsBlocking(
builder,
download_willResumeWithResponse_fromByte_,
);
NSURLDownloadDelegate.download_didReceiveDataOfLength_.implementAsBlocking(
builder,
download_didReceiveDataOfLength_,
);
NSURLDownloadDelegate.download_shouldDecodeSourceDataOfMIMEType_.implement(
builder,
download_shouldDecodeSourceDataOfMIMEType_,
);
NSURLDownloadDelegate.download_decideDestinationWithSuggestedFilename_
.implementAsBlocking(
builder,
download_decideDestinationWithSuggestedFilename_,
);
NSURLDownloadDelegate.download_didCreateDestination_.implementAsBlocking(
builder,
download_didCreateDestination_,
);
NSURLDownloadDelegate.downloadDidFinish_.implementAsBlocking(
builder,
downloadDidFinish_,
);
NSURLDownloadDelegate.download_didFailWithError_.implementAsBlocking(
builder,
download_didFailWithError_,
);
builder.addProtocol($protocol);
return NSURLDownloadDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}