connectivity 0.0.1+1 copy "connectivity: ^0.0.1+1" to clipboard
connectivity: ^0.0.1+1 copied to clipboard

discontinuedreplaced by: connectivity_plus
outdatedDart 1 only

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.

1.87k
likes
0
points
31.3k
downloads

Publisher

verified publisherflutter.dev

Weekly Downloads

Allows developers to discover the state of the network connectivity.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on connectivity