urlTestAll method

  1. @override
Future<Map<String, int>> urlTestAll(
  1. List<String> links, {
  2. int timeout = 7000,
})
override

Test multiple URLs and return latencies

Implementation

@override
Future<Map<String, int>> urlTestAll(
  List<String> links, {
  int timeout = 7000,
}) async {
  final result = await methodChannel.invokeMethod<Map<dynamic, dynamic>>(
    'url_test_all',
    {'links': links, 'timeout': timeout},
  );
  if (result == null) return {};
  return result.map((key, value) {
    final intValue = value is int ? value : (value as num).toInt();
    return MapEntry(key.toString(), intValue);
  });
}