🌐 internet_health_plus
Advanced Internet Connectivity, Latency & Network Quality Detection for Flutter.
📸 Example App Preview
📝 Description
internet_health_plus is a production-ready Flutter plugin designed to provide real internet reachability, latency measurement, and network quality detection — far beyond what connectivity_plus offers.
It helps apps react to:
- Slow networks
- Sudden latency spikes
- Dropped internet
- Captive portals
- Poor connections disguised as Wi-Fi/Mobile
✨ Features
- ✔ Real-time internet reachability
- ✔ Latency measurement (ms)
- ✔ Network quality classification
- ✔ Connectivity Plus integration
- ✔ Socket fallback
- ✔ Retry logic with backoff
- ✔ Custom thresholds
- ✔ Highly configurable
- ✔ Production tested
All with battery-optimized active probing.
Platform Support
| Platform | Supported |
|---|---|
| Android | ✅ |
| iOS | ✅ |
| macOS | ✅ |
| Web | ✅ |
| Linux | ✅ |
| Windows | ✅ |
🚀 Installation
dependencies:
internet_health_plus: ^1.0.4
📦 Import
import 'package:internet_health_plus/internet_health_plus.dart';
🎯 Quick Usage
final checker = InternetHealthPlus();
checker.onStatusChange.listen((status) {
print('Network: ${status.networkType}');
print('Reachable: ${status.internetAvailable}');
print('Latency: ${status.latencyMs}');
print('Quality: ${status.quality}');
});
&
checker.hasInternetAccess();
🔥 Manual Refresh
final result = await checker.checkInternetDetailed();
print(result.quality);
🛠 Customization (ProbeOptions)
final checker = InternetHealthPlus(
options: ProbeOptions(
timeout: Duration(seconds: 3),
periodicProbeInterval: Duration(seconds: 5),
latencyThresholds: {
'good': 80,
'moderate': 250,
},
),
);
Options include:
| Option | Description |
|---|---|
httpUrl |
Ping this URL |
timeout |
Probe timeout |
periodicProbeInterval |
Auto-check interval |
latencyThresholds |
Define good/moderate/slow |
useHttpHeadWhenHttp |
Use HEAD for faster check |
socketHost/socketPort |
Fallback method |
🐢 Detect Slow Internet
checker.onStatusChange.listen((status) {
if (status.isSlow) {
print("Warning: Slow internet detected");
}
});
🧠 Architecture
+-------------------------------+
| InternetHealthPlus |
|-------------------------------|
| Connectivity listener |
| HTTP probe (Dio) |
| Socket fallback |
| Latency measurement |
| Debounce + rate-limit |
| Retry with backoff |
| Emits InternetStatus |
+-------------------------------+
|
v
+-----------------------+
| InternetStatus |
+-----------------------+
| networkType |
| internetAvailable |
| latencyMs |
| quality |
+-----------------------+
📄 License
MIT © SakshamSharma2026