こんにちは、皆さん、VS Code で突然問題が発生しました。いくつかの Flutter アプリで Streamcontroller.sink.add(); 突然引数「プッシュ」が必要になります(そうなる前に)。
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 が思い出したように、ドキュメントにはこの要件が示されていません。これがどのように変更されたのかわかりません。現時点での質問は次のとおりです。
正常に戻すにはどうすればよいですか?