connectivity_widget
3.0.0, released 3 years ago by gpalma.pt
A Flutter widget and utility to monitor internet connectivity status by pinging a remote server.
What it does
It provides a ConnectivityWidget with a builder to display different UIs depending on whether the phone has internet access. It verifies actual internet availability by pinging a remote server alongside network/WiFi status, and offers a ConnectivityUtils class for stream-based and future-based checks.
AI-written summary of version 3.0.0, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display online or offline UI states based on real internet connectivity rather than just network interface status.
- You want to execute callbacks when the device transitions between online and offline states.
Skip it when
- You are targeting web applications where browser request caching can lead to uncertain connection verification results.
- You only need local network interface type detection without pinging external endpoints.
Strengths
- Verifies true internet connectivity by pinging a remote server instead of just checking local network state.
- Provides both UI builder widgets and utility streams for checking connection status anywhere in the app.
Weaknesses
- Web browser request caching can interfere with reliable connection verification.
- Relies on external server availability for ping checks.
Setup
- Kind
- Flutter widgets
- Effort
- Low
- Code generation
- No
- Direct dependencies
- 5
not documented
ConnectivityWidget(
builder: (context, isOnline) => Center(
child: Text(isOnline ? 'Online' : 'Offline'),
),
)Alternatives
Packages that do the same job and could replace connectivity_widget.
- app_settings
Open iOS and Android phone settings pages from a Flutter app.
89Compare - connectivity_wrapper
Provides network-aware widgets and connectivity feedback for Flutter applications.
83Compare - flml_internet_checker
Zero-dependency internet connectivity checker with blocking screens and banners.
67Compare - simple_connection_checker
Check device internet connection and listen to status changes.
53Compare
Works with
Packages commonly used together with connectivity_widget: ones it builds on, ones built on it, and its own family.
- rxdartconnectivity_widget depends on itImplementation of the ReactiveX API for asynchronous programming leveraging native Dart Streams.
- connectivity_plusconnectivity_widget depends on itDiscover the state of network connectivity (WiFi, mobile, ethernet) on Android, iOS, Web and desktops.
- retryconnectivity_widget depends on itProvides automatic retry with exponential back‑off for async functions.