implement static method
NSURLConnectionDataDelegate
implement({
- NSURLRequest? connection_willSendRequest_redirectResponse_()?,
- void connection_didReceiveResponse_()?,
- void connection_didReceiveData_(
- NSURLConnection,
- NSData
- NSInputStream? connection_needNewBodyStream_()?,
- void connection_didSendBodyData_totalBytesWritten_totalBytesExpectedToWrite_()?,
- NSCachedURLResponse? connection_willCacheResponse_()?,
- void connectionDidFinishLoading_()?,
- void connection_didFailWithError_(
- NSURLConnection,
- NSError
- bool connectionShouldUseCredentialStorage_()?,
- void connection_willSendRequestForAuthenticationChallenge_()?,
- bool connection_canAuthenticateAgainstProtectionSpace_()?,
- void connection_didReceiveAuthenticationChallenge_()?,
- void connection_didCancelAuthenticationChallenge_()?,
- bool $keepIsolateAlive = true,
override
Builds an object that implements the NSURLConnectionDataDelegate protocol. To implement
multiple protocols, use addToBuilder or objc.ObjCProtocolBuilder directly.
If $keepIsolateAlive is true, this protocol will keep this isolate
alive until it is garbage collected by both Dart and ObjC.
Implementation
static NSURLConnectionDataDelegate implement({
NSURLRequest? Function(NSURLConnection, NSURLRequest, NSURLResponse?)?
connection_willSendRequest_redirectResponse_,
void Function(NSURLConnection, NSURLResponse)?
connection_didReceiveResponse_,
void Function(NSURLConnection, objc.NSData)? connection_didReceiveData_,
objc.NSInputStream? Function(NSURLConnection, NSURLRequest)?
connection_needNewBodyStream_,
void Function(NSURLConnection, DartNSInteger, DartNSInteger, DartNSInteger)?
connection_didSendBodyData_totalBytesWritten_totalBytesExpectedToWrite_,
NSCachedURLResponse? Function(NSURLConnection, NSCachedURLResponse)?
connection_willCacheResponse_,
void Function(NSURLConnection)? connectionDidFinishLoading_,
void Function(NSURLConnection, objc.NSError)? connection_didFailWithError_,
bool Function(NSURLConnection)? connectionShouldUseCredentialStorage_,
void Function(NSURLConnection, NSURLAuthenticationChallenge)?
connection_willSendRequestForAuthenticationChallenge_,
bool Function(NSURLConnection, NSURLProtectionSpace)?
connection_canAuthenticateAgainstProtectionSpace_,
void Function(NSURLConnection, NSURLAuthenticationChallenge)?
connection_didReceiveAuthenticationChallenge_,
void Function(NSURLConnection, NSURLAuthenticationChallenge)?
connection_didCancelAuthenticationChallenge_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSURLConnectionDataDelegate',
);
NSURLConnectionDataDelegate.connection_willSendRequest_redirectResponse_
.implement(builder, connection_willSendRequest_redirectResponse_);
NSURLConnectionDataDelegate.connection_didReceiveResponse_.implement(
builder,
connection_didReceiveResponse_,
);
NSURLConnectionDataDelegate.connection_didReceiveData_.implement(
builder,
connection_didReceiveData_,
);
NSURLConnectionDataDelegate.connection_needNewBodyStream_.implement(
builder,
connection_needNewBodyStream_,
);
NSURLConnectionDataDelegate
.connection_didSendBodyData_totalBytesWritten_totalBytesExpectedToWrite_
.implement(
builder,
connection_didSendBodyData_totalBytesWritten_totalBytesExpectedToWrite_,
);
NSURLConnectionDataDelegate.connection_willCacheResponse_.implement(
builder,
connection_willCacheResponse_,
);
NSURLConnectionDataDelegate.connectionDidFinishLoading_.implement(
builder,
connectionDidFinishLoading_,
);
NSURLConnectionDataDelegate.connection_didFailWithError_.implement(
builder,
connection_didFailWithError_,
);
NSURLConnectionDataDelegate.connectionShouldUseCredentialStorage_.implement(
builder,
connectionShouldUseCredentialStorage_,
);
NSURLConnectionDataDelegate
.connection_willSendRequestForAuthenticationChallenge_
.implement(
builder,
connection_willSendRequestForAuthenticationChallenge_,
);
NSURLConnectionDataDelegate
.connection_canAuthenticateAgainstProtectionSpace_
.implement(builder, connection_canAuthenticateAgainstProtectionSpace_);
NSURLConnectionDataDelegate.connection_didReceiveAuthenticationChallenge_
.implement(builder, connection_didReceiveAuthenticationChallenge_);
NSURLConnectionDataDelegate.connection_didCancelAuthenticationChallenge_
.implement(builder, connection_didCancelAuthenticationChallenge_);
builder.addProtocol($protocol);
return NSURLConnectionDataDelegate.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}