HttpAuthRequest class

Defines the parameters of a pending HTTP authentication request received by the webview through a HttpAuthRequestCallback.

Platform specific implementations can add additional fields by extending this class and providing a factory method that takes the HttpAuthRequest as a parameter.

This example demonstrates how to extend the HttpAuthRequest to provide additional platform specific parameters.

When extending HttpAuthRequest, additional parameters should always accept null or have a default value to prevent breaking changes.

@immutable
class WKWebViewHttpAuthRequest extends HttpAuthRequest {
  WKWebViewHttpAuthRequest._(
    HttpAuthRequest authRequest,
    this.extraData,
  ) : super(
     onProceed: authRequest.onProceed,
     onCancel: authRequest.onCancel,
     host: authRequest.host,
     realm: authRequest.realm,
  );

  factory WKWebViewHttpAuthRequest.fromHttpAuthRequest(
    HttpAuthRequest authRequest, {
    String? extraData,
  }) {
    return WKWebViewHttpAuthRequest._(
      authRequest,
      extraData: extraData,
    );
  }

  final String? extraData;
}
Annotations

Constructors

HttpAuthRequest({required void onProceed(WebViewCredential credential), required void onCancel(), required String host, String? realm})
Creates a HttpAuthRequest.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
host String
The host requiring authentication.
final
onCancel → void Function()
The callback to cancel authentication.
final
onProceed → void Function(WebViewCredential credential)
The callback to authenticate.
final
realm String?
The realm requiring authentication.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited