ConnectivityService class

Web 端连通性检测与网络信息采集服务 / Connectivity detection and network information service for the web platform.

浏览器无法枚举网卡(无 dart:io),因此 IP / 网关 / MAC 等字段恒为 null; 主动可达性探测改为对公共端点发起 HTTP 请求 / Browsers cannot enumerate network interfaces (no dart:io), so IP / gateway / MAC fields are always null; the reachability probe performs an HTTP request against a public endpoint instead.

Properties

hashCode int
The hash code for this object.
no setterinherited
onConnectivityChanged Stream<NetworkConnectionInfo>
监听网络连接变化 / Emits a fresh snapshot whenever connectivity changes.
no setter
reachabilityProbe Future<bool> Function()
主动可达性探测实现 / Reachability probe used when explicitly requested.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

checkConnection({bool includeNativeDetails = true, bool probeReachability = false, Duration probeTimeout = const Duration(seconds: 3)}) Future<NetworkConnectionInfo>
采集一次网络连接快照 / Captures one network connection snapshot.
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