Future<bool> isConnected() async { var connectivityResult = await connectivity.checkConnectivity(); if (connectivityResult == ConnectivityResult.none) { return false; } else { return true; } }