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

@injectable
class NetworkUtil {
  Future<bool> get isConnected async => await _checkInternetConnect();

  _checkInternetConnect() async {
    final connectResult = await Connectivity().checkConnectivity();

    if (connectResult == ConnectivityResult.mobile ||
        connectResult == ConnectivityResult.wifi) {
      return true;
    } else {
      return false;
    }
  }
}
