internet_health_plus 1.0.1 copy "internet_health_plus: ^1.0.1" to clipboard
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 #

βœ” 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


4
likes
0
points
19
downloads

Publisher

unverified uploader

Weekly Downloads

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 β€” with a battery-optimised and production-ready engine.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

connectivity_plus, dio, flutter

More

Packages that depend on internet_health_plus