getSystemProxyForUri method

  1. @override
Future<Iterable<ProxyDto>?> getSystemProxyForUri(
  1. Uri uri
)
override

Implementation

@override
Future<Iterable<ProxyDto>?> getSystemProxyForUri(Uri uri) async {
  final jsonProxies = await methodChannel.invokeMethod<String?>(
      getSystemProxyForUriMethodName, {"uri": uri.toString()});
  if (jsonProxies != null || jsonProxies!.isNotEmpty) {
    final Iterable proxies = json.decode(jsonProxies);
    List<ProxyDto> desProxies =
        List<ProxyDto>.from(proxies.map((model) => ProxyDto.fromJson(model)));
    return desProxies;
  } else {
    return [];
  }
}