package com.example.base.utils

import android.content.Context
import android.net.ConnectivityManager
import android.net.NetworkInfo

object NetworkUtils {

    fun isNetWorkAvailable(context: Context): Boolean {
        return try {
            val networkInfo: NetworkInfo? = (context.getSystemService("connectivity") as ConnectivityManager).getActiveNetworkInfo()
            networkInfo != null && networkInfo.isAvailable
        } catch (var1: Throwable) {
            true
        }
    }
}