V2rayBoxPlatform class abstract

Inheritance
  • Object
  • PlatformInterface
  • V2rayBoxPlatform
Implementers

Constructors

V2rayBoxPlatform()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Static Properties

instance V2rayBoxPlatform
getter/setter pair