NetworkPolicy class

Monitors and provides the current network connectivity status.

This class uses connectivity_plus to listen for network changes.

Properties

hashCode int
The hash code for this object.
no setterinherited
isOffline bool
True if the device is currently offline.
no setter
isOnline bool
True if the device is currently online.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status NetworkStatus
The current network status.
no setter
statusStream Stream<NetworkStatus>
Exposes the stream of network status changes.
no setter

Methods

checkConnectivity() Future<bool>
Manually checks and returns the current connectivity status.
dispose() → void
Disposes the network policy resources. Should be called on app shutdown.
initialize() Future<void>
Initializes the NetworkPolicy.
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

Static Properties

instance NetworkPolicy
Provides a singleton instance of NetworkPolicy.
no setter