checkReachability method

Future<void> checkReachability({
  1. required String url,
  2. required void onResult(
    1. bool isReachable
    ),
  3. Duration? timeout,
  4. ClientType? clientType,
})

Checks reachability with callback-based response handling.

Implementation

Future<void> checkReachability({
  required String url,
  required void Function(bool isReachable) onResult,
  Duration? timeout,
  ClientType? clientType,
}) async {
  final result =
      await isReachable(url, timeout: timeout, clientType: clientType);
  onResult(result);
}