DefaultObServingStrategy class
This is the strategy used if you don't supply any strategy to the InternetConnectivity class, you will have to cancel the subscription manually.
- Inheritance
-
- Object
- InternetObservingStrategy
- SocketObservingStrategy
- DefaultObServingStrategy
Constructors
-
DefaultObServingStrategy({Duration? timeOut, Duration interval = kDefaultInterval, Duration? initialDuration = kDefaultInitialDuration, List<
InternetAddress> internetAddresses = kDefaultInternetAddresses})
Properties
- disposeOnFirstConnected → bool
-
If true, the strategy will stop observing for internet changes as soon as the device is online
no setterinherited
- disposeOnFirstDisconnected → bool
-
If true, the strategy will stop observing for internet changes as soon as the device is offline
no setterinherited
- duration → Duration?
-
The duration to listen for connection event
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
-
hasInternetConnection
→ Future<
bool> -
The observing strategy is to ping each of the internetAddresses supplied,
Using
stream.any
to check for the first address to connect. Once an address connects, it is assumed that there is internet access and the process stopsno setterinherited - initialDuration → Duration?
-
The initial duration to wait before observing internet access
finalinherited
-
internetAddresses
↔ List<
InternetAddress> -
A list of internet addresses (with port and timeout) to ping.
getter/setter pairinherited
- interval → Duration
-
The interval between periodic observing.
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- timeOut → Duration?
-
The timeout period before a check request is dropped and an address is
considered unreachable.
finalinherited
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