connectivity 0.0.1+1

outdated Dart 2 incompatible

Allows developers to discover the state of the network connectivity.

connectivity #

This plugin allows Flutter apps to discover network connectivity and configure themselves accordingly. It can distinguish between cellular vs wifi connection.

Note that on Android, this does not guarantee connection to Internet. For instance, the app might have wifi access but it might be a VPN or a hotel Wifi with no access.

Sample usage:

import 'package:connectivity/connectivity.dart' as connectivity;

var connectivityResult = await connectivity.checkConnectivity();
if (connectivityResult == ConnectivityResult.mobile) {
  // I am connected to a mobile network.
} else if (connectivityResult == ConnectivityResult.wifi) {
  // I am connected to a wifi network.
}

Getting Started #

For help getting started with Flutter, view our online documentation.

For help on editing plugin code, view the documentation.

802
likes
0
pub points
99%
popularity

Publisher

flutter.dev

Allows developers to discover the state of the network connectivity.

Homepage
Repository (GitHub)
View/report issues

More

Packages that depend on connectivity