ConnectionChecker class

The class is responsbile for checking and monitoring the actual internet connection by wrapping the Connectivity class and adding some extra checks.

Constructors

ConnectionChecker({bool checkHostReachability = true, List<ConnectionEntry>? checkConnectionEntriesNative, List<ConnectionEntry>? checkConnectionEntriesWeb, Duration? hostReachabilityTimeout, String? baseUrlLookupAddress, Duration? requestInterval, int? failureAttempts})
Contructs an instance of the ConnectionChecker class.
factory
ConnectionChecker.fromReachabilityChecker({required HostReachabilityChecker hostReachabilityChecker, Duration? requestInterval, int? failureAttempts})
Factory method an instance of the ConnectionChecker class.
factory
ConnectionChecker.test({required Connectivity connectivity, required HostReachabilityChecker hostReachabilityChecker, required Mapper<List<ConnectivityResult>, List<ConnectionType>> connectionTypeMapper, bool checkHostReachability = true, List<ConnectionEntry>? checkConnectionEntriesNative, List<ConnectionEntry>? checkConnectionEntriesWeb, Duration? hostReachabilityTimeout, String? baseUrlLookupAddress, Duration? requestInterval, int? failureAttempts})
Constructs a special ConnectionChecker instance, for the sake of unit testing.
factory

Properties

connectionStream Stream<bool>
Returns the reliable internet connection status every time when either Connectivity.onConnectivityChanged fires or provided in constructor's requestInterval goes by.
no setter
connectionTypes Future<List<ConnectionType>>
Returns the current List<ConnectionType> of your device.
no setter
hashCode int
The hash code for this object.
no setterinherited
isConnected Future<bool>
Returns the actual, reliable internet connection status for the present moment.
no setter
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
untilConnects() Future<void>
Resolves as soon as internet connection status get back from offline state.

Operators

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