WebResourceRequest class

Defines the parameters of the web resource request from the associated request.

Platform specific implementations can add additional fields by extending this class.

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

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

class AndroidWebResourceRequest extends WebResourceRequest {
  WebResourceRequest._({
    required WebResourceRequest request,
  }) : super(
    uri: request.uri,
  );

  factory AndroidWebResourceRequest.fromWebResourceRequest(
    WebResourceRequest request, {
    Map<String, String> headers,
  }) {
    return AndroidWebResourceRequest._(request, headers: headers);
  }

  final Map<String, String> headers;
}
Annotations

Constructors

WebResourceRequest({required Uri uri})
Used by the platform implementation to create a new WebResourceRequest.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
uri Uri
URI for the request.
final

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