startV2Ray method
Future<void>
startV2Ray({
- required String remark,
- required String config,
- required String notificationDisconnectButtonName,
- List<
String> ? blockedApps, - List<
String> ? bypassSubnets, - bool proxyOnly = false,
override
Starts the V2Ray connection with the given configuration and settings.
remark
is a string identifier for the connection.
config
is the V2Ray configuration in JSON format.
notificationDisconnectButtonName
is the text for the disconnect button in notifications.
blockedApps
is an optional list of apps to block.
bypassSubnets
is an optional list of subnets to bypass.
proxyOnly
is a boolean indicating whether to use proxy-only mode (default is false).
Returns a Future that completes when the connection starts.
Implementation
@override
Future<void> startV2Ray({
required String remark,
required String config,
required String notificationDisconnectButtonName,
List<String>? blockedApps,
List<String>? bypassSubnets,
bool proxyOnly = false,
}) async {
await methodChannel.invokeMethod('startV2Ray', {
'remark': remark,
'config': config,
'blocked_apps': blockedApps,
'bypass_subnets': bypassSubnets,
'proxy_only': proxyOnly,
'notificationDisconnectButtonName': notificationDisconnectButtonName,
});
}