大家下午好,我突然遇到了 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 提醒的那样,文档没有显示这个要求;我不知道这会如何改变,此时的问题是:
如何恢复正常?