/*
 * @Author: XianKaiQun
 * @Date: 2020-08-26 17:08:19
 * @LastEditors: XianKaiQun
 * @LastEditTime: 2020-09-08 16:52:04
 * @Description: 
 */

import 'package:connectivity_plus/connectivity_plus.dart';
export 'package:connectivity_plus/connectivity_plus.dart';

///网络类型判断
///检测是否已经接入网络
class WConnectivityUtil {
  WConnectivityUtil._();
  // static WConnectivityUtil _instance;
  // static WConnectivityUtil get instance {
  //   _instance ??= WConnectivityUtil._();
  //   return _instance;
  // }

  ///是否已连接wifi或蜂窝网络
  ///
  ///注意：这只是判断手机网络状态，不能判断是否能够联网
  static Future<bool> get connected async {
    final res = await Connectivity().checkConnectivity();
    return res != ConnectivityResult.none;
  }
}
