ConnectionType enum
Represents the physical or logical medium of the active network connection.
Understanding the ConnectionType is critical for bandwidth management
(e.g., deferring large downloads on Cellular) and optimizing latency.
Values
- wifi → const ConnectionType
-
Connected via a wireless local area network (802.11 WiFi). Typically implies higher bandwidth and lower cost than cellular.
- cellular → const ConnectionType
-
Connected via a mobile carrier network (e.g., LTE, 5G, 3G). Usually implies metered data and potentially higher latency.
- ethernet → const ConnectionType
-
Connected via a physical RJ45 Ethernet cable. The most stable and high-performance connection type.
- vpn → const ConnectionType
-
Connected through a Virtual Private Network (VPN) tunnel. Indicates that traffic is being routed through an encrypted tunnel which might mask the true underlying connection type (WiFi/Cellular).
- bluetooth → const ConnectionType
-
Connected via Bluetooth tethering or a personal area network (PAN). Characterized by very low bandwidth and limited range.
- loopback → const ConnectionType
-
A local loopback interface (typically 127.0.0.1). Indicates the device is communicating with itself; no external internet.
- unknown → const ConnectionType
-
The connection type could not be identified by the OS or the engine. This is the fallback for unknown or experimental interface types.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
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
Static Methods
-
default_(
) → Future< ConnectionType> -
Returns
`ConnectionType::Unknown`as the default state.
Constants
-
values
→ const List<
ConnectionType> - A constant List of the values in this enum, in order of their declaration.