InternetCheckOption class

Options for checking the internet connectivity to an address.

This class provides a way to specify options for checking the connectivity of an address. It includes the URI to check and the timeout duration for the HEAD request.

Usage Example:

final options = InternetCheckOption(
  uri: Uri.parse('https://example.com'),
  timeout: Duration(seconds: 5),
);

Constructors

InternetCheckOption({required Uri uri, Duration timeout = const Duration(seconds: 3), Map<String, String> headers = const {}, ResponseStatusFn? responseStatusFn})
Creates an InternetCheckOption instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
A map of additional headers to send with the request.
final
responseStatusFn ResponseStatusFn
A custom callback function to decide whether the request succeeded or not.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
timeout Duration
The duration after the HEAD request should be timed out.
final
uri Uri
URI to check for connectivity. A HEAD request will be made to this URI.
final

Methods

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

Operators

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

Static Properties

defaultResponseStatusFn ResponseStatusFn
The default responseStatusFn. Success is considered if the status code is 200.
getter/setter pair