Skip to content
pubscout

connection_network_type

1.0.1, released 7 months ago by meloti.com.br

Detects current network type and listens for connectivity changes on iOS and Android.

WASM-ready
$ flutter pub add connection_network_type
Source repository

What it does

Provides a method to get the current network status, distinguishing Wi‑Fi, various mobile generations (2G‑5G) and other connections. Emits a stream that notifies listeners whenever the network state changes.

AI-written summary of version 1.0.1, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to know whether the user is on Wi‑Fi or a specific mobile generation
  • You want to react in real time to connectivity changes in a Flutter app

Skip it when

  • Your app must run on web, desktop, or platforms other than Android/iOS
  • You only need basic online/offline detection without detailed network types

Strengths

  • Detailed mobile network classification (2G‑5G, TD‑SCDMA)
  • Real‑time stream of network changes
  • Works on both Android and iOS

Weaknesses

  • Limited to Android and iOS only
  • Requires READ_PHONE_STATE permission on Android
  • Does not provide HTTP/network request capabilities

Setup

Kind
Plugin (native code)
Effort
Medium
Code generation
No
Direct dependencies
1

Add READ_PHONE_STATE permission to AndroidManifest and request it at runtime on Android; no extra build steps required

await Permission.phone.request();
NetworkStatus status = await ConnectionNetworkType().currentNetworkStatus();
ConnectionNetworkType().onNetworkStateChanged.listen((NetworkStatus s) { /* handle change */ });

Alternatives

Packages that do the same job and could replace connection_network_type.

  • connectivity_plus

    Provides basic online/offline and Wi‑Fi vs mobile status across more platforms, including web and desktop

Works with

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