UNetworkStatus class
Network snapshot: types, metered, roaming, speed, captive portal… (see UNetwork).
- Annotations
Constructors
-
UNetworkStatus({Set<
UNetworkType> types = const <UNetworkType>{}, bool connected = false, bool? internet, bool captivePortal = false, bool metered = false, bool constrained = false, bool? roaming, String? cellularGeneration, int? downlinkKbps, int? uplinkKbps, int? rttMs, int? signalStrength, String? interfaceName}) -
const
-
UNetworkStatus.fromMap(Map<
String, Object?> map) -
Reads it from the native map.
factory
Properties
- captivePortal → bool
-
Behind a sign-in page (hotel / airport Wi-Fi): connected but not usable yet.
final
- cellularGeneration → String?
-
"2g", "3g", "4g" or "5g" for cellular; on the web the effective type ("slow-2g" … "4g").
final
- connected → bool
-
A network with a route out exists.
final
- constrained → bool
-
Data Saver (Android) / Low Data Mode (iOS) / browser "save-data" is on.
final
- downlinkKbps → int?
-
Estimated bandwidth, when the platform provides it.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- interfaceName → String?
-
Name of the interface carrying the default route (wlan0, en0, …), when known.
final
- internet → bool?
-
The OS verified it reaches the internet (Android VALIDATED, Linux FULL, Windows
NLM internet). Null when the platform cannot tell; use UConnectivity.hasInternet then.
final
- isBluetooth → bool
-
Bluetooth tethering.
no setter
- isCellular → bool
-
On mobile data.
no setter
- isEthernet → bool
-
On a cable.
no setter
- isFast → bool
-
Good enough for video / big downloads by the platform's own estimate.
no setter
- isOffline → bool
-
No network.
no setter
- isOnline → bool
-
A network is connected.
no setter
- isUnmetered → bool
-
Suitable for large transfers: online, not metered and not in a data-saving mode.
no setter
- isVpn → bool
-
VPN active.
no setter
- isWifi → bool
-
On Wi-Fi.
no setter
- metered → bool
-
The user pays per byte (cellular, hotspot, a Wi-Fi marked metered).
final
- primary → UNetworkType?
-
The transport carrying traffic; VPN only when it is the sole transport.
no setter
- roaming → bool?
-
Roaming (null when unknown).
final
- rttMs → int?
-
Estimated round-trip time (web).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signalStrength → int?
-
Signal strength in dBm (Android 10+).
final
-
types
→ Set<
UNetworkType> -
Every transport the active network uses (a VPN over Wi-Fi reports both).
final
- uplinkKbps → int?
-
Upload speed estimate.
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, Object?> - As a map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
Constants
- offline → const UNetworkStatus
- No network at all.
- unknown → const UNetworkStatus
- Before the first native snapshot arrives. Treated as online so nothing blocks on startup.