visual-studio-code - Flutter on VS Code 问题:StreamController.Sink.add() 突然需要参数 PUSH
问题描述
大家下午好,我突然遇到了 VS Code 的问题:在几个 Flutter 应用程序中 Streamcontroller.sink.add(); 突然需要参数“push”(在它没有之前)。
不添加 push 参数显然会返回错误
2 required argument(s) expected, but 1 found.dart(not_enough_required_arguments)
有谁知道可能发生了什么?提前感谢您的帮助弗朗切斯科
编辑:通过 f12 定义实际上显示了参数 push
part of dart.core;
/**
* A generic destination for data.
*
* Multiple data values can be put into a sink, and when no more data is
* available, the sink should be closed.
*
* This is a generic interface that other data receivers can implement.
*/
abstract class Sink<T> {
/**
* Adds [data] to the sink.
*
* Must not be called after a call to [close].
*/
void add(T data, Future push);
/**
* Closes the sink.
*
* The [add] method must not be called after this method.
*
* Calling this method more than once is allowed, but does nothing.
*/
void close();
}
但正如 pskink 提醒的那样,文档没有显示这个要求;我不知道这会如何改变,此时的问题是:
如何恢复正常?
解决方案
推荐阅读
- python - pip install 不工作,找不到分发
- c# - 无法在 WPF 中的 DevExpress DxTabControl 中获取当前活动/选定的 TabITem
- html - 为什么浮动在 div 中的行为是这样的
- julia - 在 Julia 中创建随机 SIR 模型
- c# - 系统在C#中通过Process模块运行命令时找不到指定的文件
- java - Firebase Cloud Firestore:查询未更新 Android 中的 ArrayList
- reactjs - 如何使用嵌套值监听 formik 字段的变化?
- excel - 通过查找关联行来构建依赖选项列表
- python - Python中magrittr中tidiverse的点占位符功能,特别是Pandas
- android - 如何从 Android 应用程序查看 Adobe Launch 数据?