NetworkInfo class
Information about the device's network connectivity.
Contains details about network connection type, speed, and interface information.
- Annotations
Constructors
- NetworkInfo({required String connectionType, required String networkSpeed, required bool isConnected, required String ipAddress, required String macAddress})
-
Creates a new NetworkInfo instance.
const
Properties
- connectionType → String
-
Type of network connection ('wifi', 'mobile', 'ethernet', 'none').
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- ipAddress → String
-
Current IP address of the device.
final
- isConnected → bool
-
Whether the device is currently connected to a network.
final
- isEthernetConnected → bool
-
Whether the device is connected via Ethernet.
no setter
- isMobileConnected → bool
-
Whether the device is connected via mobile data.
no setter
- isOffline → bool
-
Whether the device has no network connection.
no setter
- isWifiConnected → bool
-
Whether the device is connected via WiFi.
no setter
- macAddress → String
-
MAC address of the network interface.
final
- networkSpeed → String
-
Network speed description (e.g., '100 Mbps', '4G', '5G').
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
copyWith(
{String? connectionType, String? networkSpeed, bool? isConnected, String? ipAddress, String? macAddress}) → NetworkInfo - Creates a copy of this NetworkInfo with the given fields replaced.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override