FgChan<T> class
用于在Go到Dart之间传递数据的通道 Channel for passing data between Go and Dart
FgChan是一个泛型类,用于从Go代码接收数据并转换为Dart对象 使用Dart的ReceivePort和IsolateNameServer来实现跨语言通信
Constructors
- FgChan()
- 创建一个通道 Create a channel
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isClosed → bool
-
检查通道是否已关闭
Check if the channel is closed
no setter
- portId → int
-
获取当前通道的端口ID
Get the current channel port ID
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
T> -
获取Dart对象数据流
Get the Dart object data stream
no setter
Methods
-
close(
) → void - 关闭Dart通道并清理资源 Close the Dart channel and clean up resources
-
listen(
void onData(T), {Function? onError, void onDone()?, bool? cancelOnError}) → StreamSubscription - 监听Dart对象数据流 Listen to the Dart object data stream
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setPointerToDart(
T converter(Pointer< Void> )) → void - 设置指针到Dart对象的转换函数,不要手动调用 Set the pointer-to-Dart object conversion function, do not call manually
-
setPortId(
int portId) → void - 设置端口ID并注册到IsolateNameServer,不要手动调用 Set the port ID and register to IsolateNameServer, do not call manually
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited