IoPlatform class
纯 Dart 的平台实现(命令行工具、Dart VM 中的集成测试):数据保存在 dataDir,始终在前台、网络可用。
- Implemented types
Constructors
- IoPlatform({required String dataDir, String platformName = 'linux', String? deviceName, HttpTransport? http, WsConnector? webSocket, DatabaseOpener? database})
Properties
- clock → DRClock
-
final
- database → DatabaseOpener
-
final
- dataDir → String
-
final
-
foregroundChanges
→ Stream<
bool> -
前后台变化。
no setteroverride
- hashCode → int
-
The hash code for this object.
no setterinherited
- http → HttpTransport
-
final
- isForeground → bool
-
当前是否在前台;桌面端始终为 true。
no setteroverride
- isolates → IsolateRegistry?
-
IsolateNameServer 的封装;纯 Dart 环境中为 null。
no setteroverride
- isOnline → bool
-
网络是否可用。
no setteroverride
- media → MediaProcessor?
-
图片压缩、HEIC 转换、视频首帧;纯 Dart 环境中为 null(按 Web SDK 的纯 Dart 处理,不能处理的作为文件发送)。
no setteroverride
-
onlineChanges
→ Stream<
bool> -
no setteroverride
- platformName → String
-
平台标识:ios、android、macos、windows、linux(《2.功能概述文档》第 1 节)。
final
- random → RandomSource
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- secureStore → SecureStore
-
final
- webSocket → WsConnector
-
final
Methods
-
dataDirectory(
) → Future< String> -
应用支持目录(已排除备份);SDK 在其下建立
deeprespond_im/。override -
deviceId(
) → Future< String> -
设备标识:第一次使用时生成并持久保存(《2.功能概述文档》第 4 节)。
override
-
deviceInfo(
) → Future< DeviceInfo> -
设备名称、系统版本、App 版本。
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setForeground(
bool foreground) → void -
setOnline(
bool online) → void - 模拟网络和前后台的变化(测试用)。
-
toString(
) → String -
A string representation of this object.
inherited
-
withBackgroundTime<
T> (Future< T> task()) → Future<T> -
在系统允许的后台时间内执行(iOS 的 beginBackgroundTask),其他平台直接执行。
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited