| Flutter macOS Embedder |

Instance Methods | List of all members
<FlutterStreamHandler> Protocol Reference

`#import <FlutterChannels.h>`

## Instance Methods
(FlutterError *_Nullable) | - onListenWithArguments:eventSink:
(FlutterError *_Nullable) | - onCancelWithArguments:

## Detailed Description

A strategy for exposing an event stream to the Flutter side.

Definition at line 356 of file FlutterChannels.h.

## Method Documentation

## ◆ onCancelWithArguments:

- (FlutterError* _Nullable) onCancelWithArguments: |  | (id _Nullable) | arguments |

Tears down an event stream.

Invoked when the last listener is deregistered from the Stream associated to this channel on the Flutter side.

The channel implementation may call this method with `nil` arguments to separate a pair of two consecutive set up requests. Such request pairs may occur during Flutter hot restart.

Parameters

  arguments | Arguments for the stream.

Returns
  A FlutterError instance, if teardown fails.

## ◆ onListenWithArguments:eventSink:

- (FlutterError* _Nullable) onListenWithArguments: |  | (id _Nullable) | arguments
eventSink: |  | (FlutterEventSink) | events

Sets up an event stream and begin emitting events.

Invoked when the first listener is registered with the Stream associated to this channel on the Flutter side.

Parameters

  arguments | Arguments for the stream.
  events | A callback to asynchronously emit events. Invoke the callback with a `FlutterError` to emit an error event. Invoke the callback with `FlutterEndOfEventStream` to indicate that no more events will be emitted. Any other value, including `nil` are emitted as successful events.

Returns
  A FlutterError instance, if setup fails.

The documentation for this protocol was generated from the following file:

- shell/platform/darwin/common/framework/Headers/FlutterChannels.h