removeHttpAuthCredential method Null safety

Future<void> removeHttpAuthCredential(
  1. {required URLProtectionSpace protectionSpace,
  2. required URLCredential credential}
)

Removes an HTTP auth credential for that protectionSpace.

Implementation

Future<void> removeHttpAuthCredential(
    {required URLProtectionSpace protectionSpace,
    required URLCredential credential}) async {
  Map<String, dynamic> args = <String, dynamic>{};
  args.putIfAbsent("host", () => protectionSpace.host);
  args.putIfAbsent("protocol", () => protectionSpace.protocol);
  args.putIfAbsent("realm", () => protectionSpace.realm);
  args.putIfAbsent("port", () => protectionSpace.port);
  args.putIfAbsent("username", () => credential.username);
  args.putIfAbsent("password", () => credential.password);
  await _channel.invokeMethod('removeHttpAuthCredential', args);
}