MethodChannelV2rayBox class

An implementation of V2rayBoxPlatform that uses method channels.

Inheritance

Constructors

MethodChannelV2rayBox()

Properties

alertsChannel EventChannel
final
hashCode int
The hash code for this object.
no setterinherited
logsChannel EventChannel
final
methodChannel MethodChannel
final
pingChannel EventChannel
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
statsChannel EventChannel
final
statusChannel EventChannel
final

Methods

availablePort(int startPort) Future<int>
Find an available port starting from startPort
override
changeConfigOptions(String optionsJson) Future<bool>
Set configuration options
override
checkConfigJson(String configJson) Future<String>
Validate raw Xray JSON config
override
checkVpnPermission() Future<bool>
Check if VPN permission is granted
override
formatBytes(int bytes) Future<String>
Format bytes to human-readable string
override
formatConfig(String configJson) Future<String>
Format config JSON (prettify)
override
generateConfig(String configLink) Future<String>
Generate full config from link
override
Generate a subscription import link
override
getActiveConfig() Future<String>
Get active config JSON
override
getCoreEngine() Future<String>
Get the active core engine
override
getCoreInfo() Future<Map<String, dynamic>>
Get core engine info (version, engine type)
override
getDebugMode() Future<bool>
Get debug mode
override
getInstalledPackages() Future<List<AppInfo>>
Get list of installed apps
override
getLogs() Future<List<String>>
Get current log buffer
override
getPackageIcon(String packageName) Future<String?>
Get app icon as base64 string
override
getPerAppProxyList(PerAppProxyMode mode) Future<List<String>>
Get per-app proxy list
override
getPerAppProxyMode() Future<PerAppProxyMode>
Get per-app proxy mode
override
getPingTestUrl() Future<String>
Get the URL used for ping testing
override
getPlatformVersion() Future<String?>
override
getServiceMode() Future<VpnMode>
Get current service mode
override
getTotalTraffic() Future<Map<String, int>>
Get total traffic (persistent storage)
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
parseConfig(String configLink, {bool debug = false}) Future<String>
Parse and validate a config link
override
parseSubscription(String link) Future<Map<String, dynamic>>
Parse a remote profile/subscription import link
override
proxyDisplayType(String type) Future<String>
Get display name for proxy type
override
requestVpnPermission() Future<bool>
Request VPN permission Returns true if permission was already granted, false if permission dialog was shown
override
resetTotalTraffic() Future<bool>
Reset total traffic to zero
override
restart(String configLink, String name) Future<bool>
Restart VPN connection
override
selectOutbound(String groupTag, String outboundTag) Future<bool>
Select outbound in an outbound group
override
setClashMode(String mode) Future<bool>
Set clash mode (rule/global/direct)
override
setCoreEngine(String engine) Future<bool>
Set the active core engine ('xray' or 'singbox')
override
setDebugMode(bool enabled) Future<bool>
Set debug mode
override
setLocale(String locale) Future<bool>
Set the locale for the core library
override
setNotificationIcon(String iconName) Future<bool>
Set notification icon (drawable resource name)
override
setNotificationStopButtonText(String text) Future<bool>
Set notification stop button text
override
setNotificationTitle(String title) Future<bool>
Set notification title (shown when connected)
override
setPerAppProxyList(List<String> packages, PerAppProxyMode mode) Future<bool>
Set per-app proxy list
override
setPerAppProxyMode(PerAppProxyMode mode) Future<bool>
Set per-app proxy mode
override
setPingTestUrl(String url) Future<bool>
Set the URL used for ping testing
override
setServiceMode(VpnMode mode) Future<bool>
Set service mode (vpn or proxy)
override
setup() Future<void>
Initialize the VPN core
override
start(String configLink, String name) Future<bool>
Start VPN connection
override
startWithJson(String configJson, String name) Future<bool>
Start VPN with raw Xray JSON config (bypassing link parsing)
override
stop() Future<bool>
Stop VPN connection
override
toString() String
A string representation of this object.
inherited
urlTest(String link, {int timeout = 7000}) Future<int>
Test URL connectivity and return latency in ms
override
urlTestAll(List<String> links, {int timeout = 7000}) Future<Map<String, int>>
Test multiple URLs and return latencies
override
watchAlerts() Stream<Map<String, dynamic>>
Watch VPN alerts
override
watchLogs() Stream<Map<String, dynamic>>
Watch live log stream
override
watchPingResults() Stream<Map<String, dynamic>>
Watch individual ping results as they complete
override
watchStats() Stream<VpnStats>
Watch VPN traffic stats
override
watchStatus() Stream<VpnStatus>
Watch VPN status changes
override

Operators

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