implementAsBlocking static method
NSURLAuthenticationChallengeSender
implementAsBlocking({
- required void useCredential_forAuthenticationChallenge_(),
- required void continueWithoutCredentialForAuthenticationChallenge_(),
- required void cancelAuthenticationChallenge_(),
- void performDefaultHandlingForAuthenticationChallenge_()?,
- void rejectProtectionSpaceAndContinueWithChallenge_()?,
- bool $keepIsolateAlive = true,
Builds an object that implements the NSURLAuthenticationChallengeSender 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 NSURLAuthenticationChallengeSender implementAsBlocking({
required void Function(NSURLCredential, NSURLAuthenticationChallenge)
useCredential_forAuthenticationChallenge_,
required void Function(NSURLAuthenticationChallenge)
continueWithoutCredentialForAuthenticationChallenge_,
required void Function(NSURLAuthenticationChallenge)
cancelAuthenticationChallenge_,
void Function(NSURLAuthenticationChallenge)?
performDefaultHandlingForAuthenticationChallenge_,
void Function(NSURLAuthenticationChallenge)?
rejectProtectionSpaceAndContinueWithChallenge_,
bool $keepIsolateAlive = true,
}) {
final builder = objc.ObjCProtocolBuilder(
debugName: 'NSURLAuthenticationChallengeSender',
);
NSURLAuthenticationChallengeSender.useCredential_forAuthenticationChallenge_
.implementAsBlocking(
builder,
useCredential_forAuthenticationChallenge_,
);
NSURLAuthenticationChallengeSender
.continueWithoutCredentialForAuthenticationChallenge_
.implementAsBlocking(
builder,
continueWithoutCredentialForAuthenticationChallenge_,
);
NSURLAuthenticationChallengeSender.cancelAuthenticationChallenge_
.implementAsBlocking(builder, cancelAuthenticationChallenge_);
NSURLAuthenticationChallengeSender
.performDefaultHandlingForAuthenticationChallenge_
.implementAsBlocking(
builder,
performDefaultHandlingForAuthenticationChallenge_,
);
NSURLAuthenticationChallengeSender
.rejectProtectionSpaceAndContinueWithChallenge_
.implementAsBlocking(
builder,
rejectProtectionSpaceAndContinueWithChallenge_,
);
builder.addProtocol($protocol);
return NSURLAuthenticationChallengeSender.castFrom(
builder.build(keepIsolateAlive: $keepIsolateAlive),
);
}