FlutterSingBoxWindows class

Windows 平台的 FlutterSingBoxPlatform 纯 Dart 实现。

经内置 helper 驱动系统服务托管 sing-box;代理生命周期状态集中在 proxyStateStream(启动失败不抛出,经该流下发)。

Inheritance

Constructors

FlutterSingBoxWindows()

Properties

clashModeStream → Stream<ClientClashMode>
TODO: async* 的理论竞态,可改为 Stream.multi。但竞态窗口极窄,与 proxyStateStream 一致。 Clash 模式流;新订阅者立即获得最近一次模式。
no setteroverride
connectedStatusStream → Stream<ClientStatus>
客户端连接状态的更新流。
no setterinherited
groupStream → Stream<List<ClientGroup>>
分组列表流;新订阅者立即获得最近一次分组数据。
no setteroverride
hashCode → int
The hash code for this object.
no setterinherited
helperStatusProbe ↔ Future<String> Function()
存活轮询的探测点:默认查 helper /status;测试可覆写。
getter/setter pair
helperWatchInterval ↔ Duration
存活轮询间隔;默认 WindowsConstants.helperWatchInterval,测试可缩短。
getter/setter pair
logStream → Stream<List<ClientLog>>
内核日志流(事件型,不做缓存重放)。
no setteroverride
proxyStateStream → Stream<ProxyState>
TODO: async* 的理论竞态,可改为 Stream.multi。但竞态窗口极窄,无需 Stream.multi。 代理状态流;新订阅者立即获得当前状态。
no setteroverride
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

dispose() → void
释放全部轮询任务与广播流控制器。
emitClashMode(ClientClashMode mode) → void
供 HelperHttpClient 在连接成功后回调,取代直接访问 controller。
emitClientGroups(List<ClientGroup> groups) → void
供 HelperHttpClient 在连接成功后回调,取代直接访问 controller。
emitLogs(List<ClientLog> logs) → void
推送日志到 logStream。日志是事件流而非状态,不做 _last 缓存重放 (切页面的订阅者不应看到重复的最后一条),与 Android 端行为一致。
emitProxyState(ProxyState state) → void
供 HelperHttpClient 调用,取代直接访问 controller。
getSingBoxVersion() → Future<String>
返回内置 sing-box 内核版本号(随打包内核升级同步更新)。
override
init() → Future<void>
初始化:释放 sing-box.exe / libcronet.dll / clash_sing_helper.exe 到应用目录, 并清除上次异常退出遗留的系统代理(崩溃自愈)。
override
installService({required String serviceName, required String displayName, required String description}) → Future<bool>
安装 Windows 系统服务(UAC 提权经 helper CLI)。
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
queryServiceStatus() → Future<WindowsServiceStatus>
查询 Windows 端 clash_sing_service 的安装/运行状态。
override
selectOutbound({required String groupTag, required String outboundTag}) → Future<void>
经 Clash API 在 groupTag 分组中选中 outboundTag 出站。
override
serviceReload() → Future<void>
经 helper HTTP API 重启代理(等价于配置重载)。
override
setClashMode(String mode) → Future<void>
经 Clash API 设置代理模式,并在后台异步刷新模式流。
override
setGroupExpand({required String groupTag, required bool isExpand}) → Future<void>
Windows 端无持久化展开状态,空实现。
override
startService() → Future<bool>
启动已安装的 Windows 系统服务;helper.exe 缺失或异常时返回 false。
override
startVpn() → Future<void>
经 helper HTTP API 启动代理(失败不抛出,原因经 proxyStateStream 下发)。
override
stopService() → Future<bool>
停止 Windows 系统服务;helper.exe 缺失或异常时返回 false。
override
stopVpn() → Future<void>
经 helper HTTP API 停止代理。
override
toString() → String
A string representation of this object.
inherited
uninstallService() → Future<bool>
卸载 Windows 系统服务;helper.exe 缺失或异常时返回 false。
override
urlTest({required String groupTag}) → Future<void>
经 Clash API 对 groupTag 分组执行 URL 测速。
override

Operators

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

Static Methods

registerWith() → void
注册本实现为平台默认实例(由 Windows C-API 桩调用)。