MethodChannelFlutterV2ray class

An implementation of FlutterV2rayPlatform that uses method channels.

Inheritance

Properties

eventChannel EventChannel
The event channel used to receive status updates from the native platform.
final
hashCode int
The hash code for this object.
no setterinherited
methodChannel MethodChannel
The method channel used to interact with the native platform.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

getConnectedServerDelay(String url) Future<int>
Measures the delay to the currently connected V2Ray server. url is the server URL to test. Returns a Future that completes with the delay in milliseconds.
override
getCoreVersion() Future<String>
Retrieves the version of the V2Ray core. Returns a Future that completes with a String representing the core version.
override
getServerDelay({required String config, required String url}) Future<int>
Measures the delay to a V2Ray server using the provided configuration and URL. config is the V2Ray configuration in JSON format. url is the server URL to test. Returns a Future that completes with the delay in milliseconds.
override
initializeV2Ray({required void onStatusChanged(V2RayStatus status), required String notificationIconResourceType, required String notificationIconResourceName}) Future<void>
Initializes the V2Ray client with a status change callback and notification settings. onStatusChanged is a callback that will be invoked when the V2Ray status changes. notificationIconResourceType specifies the type of the notification icon resource (e.g., 'mipmap'). notificationIconResourceName specifies the name of the notification icon resource (e.g., 'ic_launcher'). Returns a Future that completes when initialization is done.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
requestPermission() Future<bool>
Requests permission to use V2Ray features, such as VPN access. Returns a Future that completes with a bool indicating whether permission was granted.
override
startV2Ray({required String remark, required String config, required String notificationDisconnectButtonName, List<String>? blockedApps, List<String>? bypassSubnets, bool proxyOnly = false}) Future<void>
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.
override
stopV2Ray() Future<void>
Stops the V2Ray connection. Returns a Future that completes when the connection is stopped.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited