Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/dart/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Flutter StreamSubscription::取消关闭流本身_Flutter_Dart_Flutter Plugin_Flutter Platform Channel_Event Channel - Fatal编程技术网

Flutter StreamSubscription::取消关闭流本身

Flutter StreamSubscription::取消关闭流本身,flutter,dart,flutter-plugin,flutter-platform-channel,event-channel,Flutter,Dart,Flutter Plugin,Flutter Platform Channel,Event Channel,上下文 我正在制作一个flatter插件来检索一些只能从本机端获得的信息。我正在通过EventChannel收集这些数据 EventChannel::receiveBroadcastStream()文档说明: 设置广播流以接收此频道上的事件 当前/预期行为 我可以在多个位置收听EventChannel::receiveBroadcastStream(),但当我尝试在其中一个位置收听StreamSubscription::cancel()时,整个流在所有位置都会关闭 我希望只有我调用cancel(

上下文

我正在制作一个flatter插件来检索一些只能从本机端获得的信息。我正在通过EventChannel收集这些数据

EventChannel::receiveBroadcastStream()文档说明:

设置广播流以接收此频道上的事件

当前/预期行为

我可以在多个位置收听EventChannel::receiveBroadcastStream(),但当我尝试在其中一个位置收听StreamSubscription::cancel()时,整个流在所有位置都会关闭

我希望只有我调用cancel()的StreamSubscription会被取消,但不会关闭流本身