FlutterNetworkConnectivity class
FlutterNetworkConnectivity checks for network availability Connected to Wifi or Cellular Data - returns true/false true - Connected to Network false - Not Connected to Network
Constructors
- FlutterNetworkConnectivity({String? lookUpUrl, bool isContinousLookUp = false, Duration? lookUpDuration})
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isInternetAvailable ↔ bool
-
check if internet is available using this bool
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
getInternetAvailabilityStream(
) → Stream< bool> - Get Internet Availability Stream based on config's Default Config: Get Stream on Connectivity Status Change Available Config's: (to be configured in constructor while object creation)
-
getNetworkStatusStream(
) → Stream< bool> -
Returns Stream of bool denoting network status
Start Listening on
initState
then proceed to registerNetworkListener true - Network connection is available false = Network connection is not available -
isInternetConnectionAvailable(
) → Future< bool> -
use this method to check to check for internet connection availability
also used on internal methods on periodic/connection status changed
override
_lookUpUrl
on constructor while object creation -
isNetworkAvailable(
) → Future< bool> - Checks if Network is Available
-
isNetworkConnectionAvailable(
) → Future< bool> - Checks if Network is Available
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerAvailabilityListener(
) → Future - Registers Network Connectivity Listener from Native
-
registerNetworkListener(
) → Future - Register Listener to check for Network Stream Must be unregistered if not in use registering only on android as iOS makes use of NetworkMonitor
-
toString(
) → String -
A string representation of this object.
inherited
-
unregisterAvailabilityListener(
) → Future - Unregister to cancel timer if set, close connection listeners from native calls
-
unregisterNetworkListener(
) → Future - Unregister Listener when not in use unregister only on android as iOS makes use of NetworkMonitor
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited