internet_health_plus 1.0.1
internet_health_plus: ^1.0.1 copied to clipboard
A powerful, modern Flutter plugin for real internet reachability, latency measurement, and dynamic network quality detection. Detect slow networks, sudden drops, and connectivity changes in real-time [...]
π 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
All with battery-optimized active probing.
π‘ Issue with connectivity_plus? #
Most apps use connectivity_plus to check Internet status, but it has an important limitation:
β connectivity_plus only tells you:
-
Whether the device is on Wi-Fi, Mobile, Ethernet, or Offline
-
NOT whether the internet actually works
-
Why this is not enough:
-
A device can be connected to Wi-Fi but still have:
-
No internet access
-
Slow or unstable internet
-
Captive portals (airport/hotel login pages)
-
High latency causing slow performance
-
Partial connectivity
In all these cases, connectivity_plus still reports wifi or mobile, even when the internet is unusable.
β€οΈ Why Choose internet_health_plus? #
β Real Internet Health #
It checks actual connectivity (HTTP + socket fallback), not just WiFi/mobile status.
β Detect Slow/Moderate/Good Networks #
Based on real latency measurements.
β Real-Time Stream Updates #
Receive events instantly via:
Stream<InternetStatus>
β Battery Efficient #
- Debouncing
- Rate limiting
- Shared Dio instance
- Retry with exponential backoff
β Works Everywhere #
- Android
- iOS
- Desktop
- Flutter Web
β Riverpod Ready #
Built for reactive state management.
β¨ 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
π Installation #
dependencies:
internet_health_plus: ^1.0.0
π¦ 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}');
});
π₯ Manual Refresh #
final result = await checker.checkInternetDetailed();
print(result.quality);
π’ Handling Slow Internet Connections #
internet_health_plus doesnβt just tell you if youβre online β it also tells you when the connection is slow, so you can:
- switch to low-data mode
- load thumbnails instead of full-res images
- delay heavy syncs or uploads
- reduce polling frequency
You get two useful signals:
- status.quality β good | moderate | slow | unknown
- status.isSlow β true when quality is slow
π§© Riverpod Integration #
final internetCheckerProvider = Provider<InternetHealthPlus>((ref) {
final checker = InternetHealthPlus();
ref.onDispose(() => checker.dispose());
return checker;
});
final internetStatusStreamProvider = StreamProvider<InternetStatus>((ref) {
final checker = ref.watch(internetCheckerProvider);
final controller = StreamController<InternetStatus>();
controller.add(checker.lastStatus);
final sub = checker.onStatusChange.listen(controller.add);
checker.checkInternetDetailed(); // initial probe
ref.onDispose(() {
sub.cancel();
controller.close();
});
return controller.stream;
});
π§ͺ Testing Slow Internet #
β Android Emulator β Edge / GPRS #
β iOS Simulator β Network Link Conditioner #
β Router throttling #
β Override thresholds: #
ProbeOptions(latencyThresholds: {'good': 5, 'moderate': 10});
π§ 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 |
+-----------------------+
π CHANGELOG.md #
## 1.0.0
- Initial release
- Internet reachability detection
- Latency measurement
- Network quality classification
- Real-time status stream
- Battery optimized probe scheduler
- Riverpod integration example
π¦ Pub.dev Metadata #
Add to pubspec.yaml:
homepage: https://github.com/SakshamSharma2026/internet_health_plus
repository: https://github.com/SakshamSharma2026/internet_health_plus
issue_tracker: https://github.com/SakshamSharma2026/internet_health_plus/issues
documentation: https://github.com/SakshamSharma2026/internet_health_plus#readme
topics:
- internet
- connectivity
- network
- latency
- performance
π License #
MIT Β© SakshamSharma2026