HttpResponseError class

Error returned in PlatformNavigationDelegate.setOnHttpError when an HTTP response error has been received.

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

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

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

class IOSHttpResponseError extends HttpResponseError {
  IOSHttpResponseError._(HttpResponseError error, {required this.domain})
      : super(
          statusCode: error.statusCode,
        );

  factory IOSHttpResponseError.fromHttpResponseError(
    HttpResponseError error, {
    required String? domain,
  }) {
    return IOSHttpResponseError._(error, domain: domain);
  }

  final String? domain;
}
Annotations

Constructors

HttpResponseError({WebResourceRequest? request, WebResourceResponse? response})
Used by the platform implementation to create a new HttpResponseError.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
request WebResourceRequest?
The associated request.
final
response WebResourceResponse?
The associated response.
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