Flutter Engine
The Flutter Engine
|
Classes | |
interface | EventSink |
interface | StreamHandler |
Public Member Functions | |
EventChannel (BinaryMessenger messenger, String name) | |
EventChannel (BinaryMessenger messenger, String name, MethodCodec codec) | |
EventChannel (BinaryMessenger messenger, String name, MethodCodec codec, BinaryMessenger.TaskQueue taskQueue) | |
void | setStreamHandler (final StreamHandler handler) |
A named channel for communicating with the Flutter application using asynchronous event streams.
Incoming requests for event stream setup are decoded from binary on receipt, and Java responses and events are encoded into binary before being transmitted back to Flutter. The MethodCodec
used must be compatible with the one used by the Flutter application. This can be achieved by creating an EventChannel counterpart of this channel on the Dart side. The Java type of stream configuration arguments, events, and error details is Object
, but only values supported by the specified MethodCodec
can be used.
The logical identity of the channel is given by its name. Identically named channels will interfere with each other's communication.
Definition at line 32 of file EventChannel.java.
|
inline |
Creates a new channel associated with the specified BinaryMessenger
and with the specified name and the standard MethodCodec
.
messenger | a BinaryMessenger . |
name | a channel name String. |
Definition at line 47 of file EventChannel.java.
|
inline |
Creates a new channel associated with the specified BinaryMessenger
and with the specified name and MethodCodec
.
messenger | a BinaryMessenger . |
name | a channel name String. |
codec | a MessageCodec . |
Definition at line 59 of file EventChannel.java.
|
inline |
Creates a new channel associated with the specified BinaryMessenger
and with the specified name and MethodCodec
.
messenger | a BinaryMessenger . |
name | a channel name String. |
codec | a MessageCodec . |
taskQueue | a BinaryMessenger.TaskQueue that specifies what thread will execute the handler. Specifying null means execute on the platform thread. See also BinaryMessenger#makeBackgroundTaskQueue() . |
Definition at line 74 of file EventChannel.java.
|
inline |
Registers a stream handler on this channel.
Overrides any existing handler registration for (the name of) this channel.
If no handler has been registered, any incoming stream setup requests will be handled silently by providing an empty stream.
handler | a StreamHandler , or null to deregister. |
Definition at line 107 of file EventChannel.java.