setProxy method
Sets a proxy for network communication.
host
: The host of the proxy server.port
: The port number for the proxy server.
Returns a String
indicating the result of the proxy configuration process.
Implementation
@override
Future<String?> setProxy(String host, int port) async {
try {
String value = await methodChannel
.invokeMethod('set-proxy', {"host": host, "port": port});
return Future.value(value);
} catch (e) {
return Future.error(e);
}
}