isConnectedToMobile function

Future<bool> isConnectedToMobile()

判断设备是否连接移动网络

Implementation

Future<bool> isConnectedToMobile() async {
  var connectivityResult = await Connectivity().checkConnectivity();
  return connectivityResult.contains(ConnectivityResult.mobile);
}