checkInternetConnection method

Future<bool> checkInternetConnection(
  1. List<Uri> urls
)

Implementation

Future<bool> checkInternetConnection(List<Uri> urls) async {
  if (urls.isEmpty) return _hasInternetConnection();

  final checks = urls.map((url) => _hasInternetConnection(testAddress: url.toString())).toList();
  final results = await Future.wait(checks);

  // Returns true if at least one of the urls is reachable.
  return results.any((result) => result == true);
}