Skip to content
pubscout

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.

WASM-ready
$ flutter pub add connectivity_widget
Source repository

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.

Works with

Packages commonly used together with connectivity_widget: ones it builds on, ones built on it, and its own family.