checkConnectivity method

Future<bool> checkConnectivity()

Manually checks and returns the current connectivity status.

Implementation

Future<bool> checkConnectivity() async {
  try {
    final results = await _connectivity.checkConnectivity();
    _updateStatus(results);
    return isOnline;
  } catch (e) {
    debugPrint('Error checking connectivity: $e');
    return false; // Assume offline on error
  }
}