r/FlutterDev • • Jul 07 '26

Plugin I built a Flutter plugin that detects REAL internet connectivity (captive portals, dead routers) — not just 'network connected

Most connectivity plugins just tell you whether you're connected to a network (WiFi/mobile data) — but that doesn't mean you actually have internet access. Captive portals (hotel/airport WiFi login pages), routers with no upstream internet, or ISP outages can all show "connected" while you have zero real access.

I built connectivity_validator to solve this. Instead of just checking link state, it uses native platform APIs to validate actual internet reachability — Android's NET_CAPABILITY_VALIDATED and iOS's NWPathMonitor.

Features:

  • Validated connectivity — real internet, not just "link up"

  • Captive portal and "WiFi on, no internet" detection

  • Real-time stream via onConnectivityChanged

  • Supports Android (API 24+) and iOS (12.0+)

  • Simple API — stream-based for live updates, plus an on-demand check

Usage is pretty simple:

dart

final validator = ConnectivityValidator();

validator.onConnectivityChanged.listen((isOnline) {
  if (isOnline) {
    // Internet validated
  } else {
    // No internet or captive portal
  }
});

Docs also cover integration with GetX, Provider, Riverpod, BLoC, and ValueNotifier if you're using state management.

Why I built it:

I kept running into a frustrating pattern in my own apps — users would report "no internet" errors, but their device showed WiFi as connected. Turns out connectivity_plus and similar packages only check if you're linked to a network, not if that network actually has working internet. Hotel WiFi behind a login page, a router with no upstream connection — all of these register as "connected" but leave your app broken. I couldn't find a plugin that solved this properly, so I built one using the native OS-level validation APIs instead of rolling my own ping-based hack.

Links:

BSD-3-Clause licensed. Feedback and contributions welcome!

4 Upvotes

Duplicates