NetworkChecker class

Network Checker Utility Checks internet connectivity using connectivity_plus package

Constructors

NetworkChecker()
factory

Properties

connectionStatusStream Stream<bool>
Stream of connection status changes
no setter
hashCode int
The hash code for this object.
no setterinherited
isConnected bool
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkConnectivity() Future<bool>
Check current connectivity status
dispose() → void
Dispose resources
getConnectionType() Future<String>
Get connection type
hasInternetConnection() Future<bool>
Check if internet is available (more reliable than just connectivity check)
initialize() Future<void>
Initialize network checker and listen to connectivity changes
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
reset() → void
Reset checker
toString() String
A string representation of this object.
inherited
waitForConnection({Duration timeout = const Duration(seconds: 30), Duration checkInterval = const Duration(seconds: 2)}) Future<bool>
Wait for internet connection (useful for retrying)

Operators

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