NetworkConnectionInfo class
当前网络连接快照 / A snapshot of the current network connection.
Constructors
- NetworkConnectionInfo({required bool isConnected, required NetworkType type, required DateTime timestamp, String? ssid, int? signalStrength, String? ipAddress, String? ipv6Address, String? gateway, String? macAddress, bool isVpn = false, bool? isReachable})
-
构造 NetworkConnectionInfo / Creates a NetworkConnectionInfo.
const
-
NetworkConnectionInfo.fromMap(Map<
Object?, Object?> map) -
从 toMap 产物还原 / Restores an instance produced by toMap.
factory
Properties
- gateway → String?
-
默认网关 / Default gateway address.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- ipAddress → String?
-
IPv4 地址 / Primary IPv4 address.
final
- ipv6Address → String?
-
IPv6 地址 / Primary IPv6 address.
final
- isConnected → bool
-
是否存在可用网络 / Whether an active network is available.
final
- isReachable → bool?
-
主动连通性探测结果(未探测时为
null)/ Result of an active reachability probe (nullwhen not probed).final - isVpn → bool
-
是否处于 VPN 通道 / Whether traffic is routed through a VPN.
final
- macAddress → String?
-
物理网卡 MAC 地址 / Hardware MAC address.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- signalStrength → int?
-
Wi-Fi 信号强度,单位 dBm / Wi-Fi signal strength in dBm.
final
- ssid → String?
-
Wi-Fi SSID(无权限或非 Wi-Fi 时为
null)/ Wi-Fi SSID (nullwithout permission or when not on Wi-Fi).final - timestamp → DateTime
-
采样时间 / Sampling timestamp.
final
- type → NetworkType
-
连接类型 / Connection type.
final
Methods
-
copyWith(
{bool? isReachable}) → NetworkConnectionInfo -
生成一份带
isReachable的副本 / Returns a copy carryingisReachable. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toMap(
) → Map< String, Object?> - 序列化为可 JSON 编码的 Map / Serialises to a JSON encodable map.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override