W3cubDocs

/Dart 2

listen method

StreamSubscription listen (void onData(dynamic message), { Function onError, void onDone(), bool cancelOnError })
override

Inherited from Stream.

Note that onError and cancelOnError are ignored since a ReceivePort will never receive an error.

The onDone handler will be called when the stream closes. The stream closes when close is called.

Implementation

StreamSubscription listen(void onData(var message),
    {Function onError, void onDone(), bool cancelOnError});

© 2012 the Dart project authors
Licensed under the Creative Commons Attribution-ShareAlike License v4.0.
https://api.dart.dev/stable/2.5.0/dart-isolate/ReceivePort/listen.html