InternetStatus enum
Reliable internet connectivity checker.
Strategy: DNS lookup on multiple reliable hosts (no HTTP overhead, no CORS issues, no rate limits). Falls back to socket connection if DNS fails. Fastest and most professional approach for production apps.
Usage: in main : await BaiomyInternetChecker.instance.initialize();
final checker = BaiomyInternetChecker.instance; await checker.initialize();
// One-time check bool online = await checker.hasConnection;
// React to changes checker.onStatusChanged.listen((status) { ... });
// Use named states if (checker.currentStatus == InternetStatus.connected) { ... }
Values
- connected → const InternetStatus
- disconnected → const InternetStatus
- checking → const InternetStatus
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
Constants
-
values
→ const List<
InternetStatus> - A constant List of the values in this enum, in order of their declaration.