- Inheritance
-
- Object
- PlatformInterface
- SingBoxPlatform
- Implementers
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
-
addAppToBypass(String packageName)
→ Future<bool>
-
Add app to bypass list (will not use VPN)
packageName - app package name (Android) or bundle ID (iOS)
-
addBlockedApp(String packageName)
→ Future<bool>
-
Add app to blocked list
packageName - app package name (Android) or bundle ID (iOS)
-
addBlockedDomain(String domain)
→ Future<bool>
-
Add domain/site to blocked list
domain - domain name or IP address
-
addDnsServer(String dnsServer)
→ Future<bool>
-
Add DNS server
dnsServer - DNS server IP address (e.g., "8.8.8.8", "1.1.1.1")
-
addDomainToBypass(String domain)
→ Future<bool>
-
Add domain/site to bypass list (will not use VPN)
domain - domain name or IP address
-
addServerConfig(SingBoxServerConfig config)
→ Future<bool>
-
Add server configuration
config - server configuration
-
addSubnetToBypass(String subnet)
→ Future<bool>
-
Add subnet to bypass list (will not use VPN)
subnet - subnet in CIDR notation (e.g., "192.168.1.0/24", "10.0.0.0/8")
-
connect(String config)
→ Future<bool>
-
Connect to VPN with specified configuration
config - JSON string with server configuration
-
disconnect()
→ Future<bool>
-
Disconnect from VPN
-
getActiveSingBoxServerConfig()
→ Future<SingBoxServerConfig?>
-
Get active server configuration
-
getBlockedApps()
→ Future<List<String>>
-
Get list of blocked apps
-
getBlockedDomains()
→ Future<List<String>>
-
Get list of blocked domains/sites
-
getBypassApps()
→ Future<List<String>>
-
Get list of apps in bypass
-
getBypassDomains()
→ Future<List<String>>
-
Get list of domains/sites in bypass
-
getBypassSubnets()
→ Future<List<String>>
-
Get list of subnets in bypass
-
getConnectionStats()
→ Future<SingBoxConnectionStats>
-
Get current connection statistics
-
getConnectionStatus()
→ Future<SingBoxConnectionStatus>
-
Get current connection status
-
getDnsServers()
→ Future<List<String>>
-
Get list of DNS servers
-
getPlatformVersion()
→ Future<String?>
-
Get platform version
-
getServerConfig(String configId)
→ Future<SingBoxServerConfig?>
-
Get server configuration by ID
configId - configuration identifier
-
getServerConfigs()
→ Future<List<SingBoxServerConfig>>
-
Get all server configurations
-
getSettings()
→ Future<SingBoxSettings>
-
Get current settings
-
initialize()
→ Future<bool>
-
Initialize plugin
Must be called before using other methods, preferably before application start
-
loadSettings()
→ Future<SingBoxSettings>
-
Load settings
-
noSuchMethod(Invocation invocation)
→ dynamic
-
Invoked when a nonexistent method or property is accessed.
inherited
-
pingCurrentServer()
→ Future<SingBoxPingResult>
-
Measure ping to current server
-
removeAppFromBypass(String packageName)
→ Future<bool>
-
Remove app from bypass list
packageName - app package name (Android) or bundle ID (iOS)
-
removeBlockedApp(String packageName)
→ Future<bool>
-
Remove app from blocked list
packageName - app package name (Android) or bundle ID (iOS)
-
removeBlockedDomain(String domain)
→ Future<bool>
-
Remove domain/site from blocked list
domain - domain name or IP address
-
removeDnsServer(String dnsServer)
→ Future<bool>
-
Remove DNS server
dnsServer - DNS server IP address
-
removeDomainFromBypass(String domain)
→ Future<bool>
-
Remove domain/site from bypass list
domain - domain name or IP address
-
removeServerConfig(String configId)
→ Future<bool>
-
Remove server configuration
configId - configuration identifier
-
removeSubnetFromBypass(String subnet)
→ Future<bool>
-
Remove subnet from bypass list
subnet - subnet in CIDR notation
-
saveSettings(SingBoxSettings settings)
→ Future<bool>
-
Save settings
settings - settings object to save
-
setActiveServerConfig(String configId)
→ Future<bool>
-
Set active server configuration
configId - configuration identifier
-
setDnsServers(List<String> dnsServers)
→ Future<bool>
-
Set DNS servers (replaces all existing DNS servers)
dnsServers - list of DNS server IP addresses
-
switchServer(String config)
→ Future<bool>
-
Switch current server
Stops current connection, changes configuration and connects to new server
config - JSON string with new server configuration
-
testSpeed()
→ Future<SingBoxSpeedTestResult>
-
Measure connection speed
-
toString()
→ String
-
A string representation of this object.
inherited
-
updateServerConfig(SingBoxServerConfig config)
→ Future<bool>
-
Update server configuration
config - updated server configuration
-
updateSetting(String key, dynamic value)
→ Future<bool>
-
Update individual setting parameter
key - parameter key (autoConnectOnStart, autoReconnectOnDisconnect, killSwitch)
value - parameter value
-
watchNotifications()
→ Stream<SingBoxNotification>
-
Subscribe to notifications from sing-box
Returns Stream with notification updates
-
watchSingBoxConnectionStats()
→ Stream<SingBoxConnectionStats>
-
Subscribe to connection statistics changes
Returns Stream with statistics updates
Statistics include: download/upload speed, bytes sent/received, ping, connection duration
-
watchSingBoxConnectionStatus()
→ Stream<SingBoxConnectionStatus>
-
Subscribe to connection status changes
Returns Stream with status updates