Files
MWClash/plugins/proxy/lib/proxy_method_channel.dart
chen08209 d89481114f Fix windows tray issues
Support setting bypassDomain

Update flutter version

Fix android service issues

Fix macos dock exit button issues

Add route address setting

Optimize provider view
2024-11-17 20:42:01 +08:00

27 lines
747 B
Dart

import 'package:flutter/foundation.dart';
import 'package:flutter/services.dart';
import 'proxy_platform_interface.dart';
/// An implementation of [ProxyPlatform] that uses method channels.
class MethodChannelProxy extends ProxyPlatform {
/// The method channel used to interact with the native platform.
@visibleForTesting
final methodChannel = const MethodChannel('proxy');
MethodChannelProxy();
@override
Future<bool?> startProxy(int port, List<String> bypassDomain) async {
return await methodChannel.invokeMethod<bool>("StartProxy", {
'port': port,
'bypassDomain': bypassDomain,
});
}
@override
Future<bool?> stopProxy() async {
return await methodChannel.invokeMethod<bool>("StopProxy");
}
}