| Flutter macOS Embedder |

Instance Methods | Class Methods | List of all members
FlutterEventChannel Class Reference

`#import <FlutterChannels.h>`

Inheritance diagram for FlutterEventChannel:

## Instance Methods
(instancetype) | - initWithName:binaryMessenger:codec:
(instancetype) | - initWithName:binaryMessenger:codec:taskQueue:
(void) | - setStreamHandler:

## Class Methods
(instancetype) | + eventChannelWithName:binaryMessenger:
(instancetype) | + eventChannelWithName:binaryMessenger:codec:

## Detailed Description

A channel for communicating with the Flutter side using event streams.

Definition at line 402 of file FlutterChannels.h.

## Method Documentation

## ◆ eventChannelWithName:binaryMessenger:

+ (instancetype) eventChannelWithName: |  | (NSString *) | name
binaryMessenger: |  | (NSObject< FlutterBinaryMessenger > *) | messenger

Creates a `FlutterEventChannel` with the specified name and binary messenger.

The channel name logically identifies the channel; identically named channels interfere with each other's communication.

The binary messenger is a facility for sending raw, binary messages to the Flutter side. This protocol is implemented by `FlutterViewController`.

The channel uses `FlutterStandardMethodCodec` to decode stream setup and teardown requests, and to encode event envelopes.

Parameters

  name | The channel name.
  messenger | The binary messenger.

## ◆ eventChannelWithName:binaryMessenger:codec:

+ (instancetype) eventChannelWithName: |  | (NSString *) | name
binaryMessenger: |  | (NSObject< FlutterBinaryMessenger > *) | messenger
codec: |  | (NSObject< FlutterMethodCodec > *) | codec

Creates a `FlutterEventChannel` with the specified name, binary messenger, and method codec.

The channel name logically identifies the channel; identically named channels interfere with each other's communication.

The binary messenger is a facility for sending raw, binary messages to the Flutter side. This protocol is implemented by `FlutterViewController`.

Parameters

  name | The channel name.
  messenger | The binary messenger.
  codec | The method codec.

## ◆ initWithName:binaryMessenger:codec:

- (instancetype) initWithName: |  | (NSString *) | name
binaryMessenger: |  | (NSObject< FlutterBinaryMessenger > *) | messenger
codec: |  | (NSObject< FlutterMethodCodec > *) | codec

Initializes a `FlutterEventChannel` with the specified name, binary messenger, and method codec.

The channel name logically identifies the channel; identically named channels interfere with each other's communication.

The binary messenger is a facility for sending raw, binary messages to the Flutter side. This protocol is implemented by `FlutterEngine` and `FlutterViewController`.

Parameters

  name | The channel name.
  messenger | The binary messenger.
  codec | The method codec.

## ◆ initWithName:binaryMessenger:codec:taskQueue:

- (instancetype) initWithName: |  | (NSString *) | name
binaryMessenger: |  | (NSObject< FlutterBinaryMessenger > *) | messenger
codec: |  | (NSObject< FlutterMethodCodec > *) | codec
taskQueue: |  | (NSObject< FlutterTaskQueue > *_Nullable) | taskQueue

Initializes a `FlutterEventChannel` with the specified name, binary messenger, method codec and task queue.

The channel name logically identifies the channel; identically named channels interfere with each other's communication.

The binary messenger is a facility for sending raw, binary messages to the Flutter side. This protocol is implemented by `FlutterEngine` and `FlutterViewController`.

Parameters

  name | The channel name.
  messenger | The binary messenger.
  codec | The method codec.
  taskQueue | The FlutterTaskQueue that executes the handler (see -[FlutterBinaryMessenger makeBackgroundTaskQueue]).

## ◆ setStreamHandler:

- (void) setStreamHandler: |  | (NSObject< FlutterStreamHandler > *_Nullable) | handler |

Registers a handler for stream setup requests from the Flutter side.

Replaces any existing handler. Use a `nil` handler for unregistering the existing handler.

Parameters

  handler | The stream handler.

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

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