connectivity 0.0.1+1
connectivity: ^0.0.1+1 copied to clipboard
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.