Flutter Engine
The Flutter Engine
|
Classes | |
interface | MessageHandler |
interface | Reply |
Public Member Functions | |
BasicMessageChannel ( @NonNull BinaryMessenger messenger, @NonNull String name, @NonNull MessageCodec< T > codec) | |
BasicMessageChannel ( @NonNull BinaryMessenger messenger, @NonNull String name, @NonNull MessageCodec< T > codec, BinaryMessenger.TaskQueue taskQueue) | |
void | send (@Nullable T message) |
void | send (@Nullable T message, @Nullable final Reply< T > callback) |
void | setMessageHandler (@Nullable final MessageHandler< T > handler) |
void | resizeChannelBuffer (int newSize) |
void | setWarnsOnChannelOverflow (boolean warns) |
Static Public Member Functions | |
static void | resizeChannelBuffer ( @NonNull BinaryMessenger messenger, @NonNull String channel, int newSize) |
static void | setWarnsOnChannelOverflow ( @NonNull BinaryMessenger messenger, @NonNull String channel, boolean warns) |
Static Public Attributes | |
static final String | CHANNEL_BUFFERS_CHANNEL = "dev.flutter/channel-buffers" |
A named channel for communicating with the Flutter application using basic, asynchronous message passing.
Messages are encoded into binary before being sent, and binary messages received are decoded into Java objects. The MessageCodec
used must be compatible with the one used by the Flutter application. This can be achieved by creating a BasicMessageChannel counterpart of this channel on the Dart side. The static Java type of messages sent and received is Object
, but only values supported by the specified MessageCodec
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 31 of file BasicMessageChannel.java.
|
inline |
Creates a new channel associated with the specified BinaryMessenger
and with the specified name and MessageCodec
.
messenger | a BinaryMessenger . |
name | a channel name String. |
codec | a MessageCodec . |
Definition at line 48 of file BasicMessageChannel.java.
|
inline |
Creates a new channel associated with the specified BinaryMessenger
and with the specified name and MessageCodec
.
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 64 of file BasicMessageChannel.java.
|
inlinestatic |
Adjusts the number of messages that will get buffered when sending messages to channels that aren't fully set up yet. For example, the engine isn't running yet or the channel's message handler isn't set up on the Dart side yet.
Definition at line 173 of file BasicMessageChannel.java.
|
inline |
Adjusts the number of messages that will get buffered when sending messages to channels that aren't fully set up yet. For example, the engine isn't running yet or the channel's message handler isn't set up on the Dart side yet.
Definition at line 141 of file BasicMessageChannel.java.
|
inline |
Sends the specified message to the Flutter application on this channel.
message | the message, possibly null. |
Definition at line 91 of file BasicMessageChannel.java.
|
inline |
Sends the specified message to the Flutter application, optionally expecting a reply.
Any uncaught exception thrown by the reply callback will be caught and logged.
message | the message, possibly null. |
callback | a Reply callback, possibly null. |
Definition at line 104 of file BasicMessageChannel.java.
|
inline |
Registers a message handler on this channel for receiving messages sent from the Flutter application.
Overrides any existing handler registration for (the name of) this channel.
If no handler has been registered, any incoming message on this channel will be handled silently by sending a null reply.
handler | a MessageHandler , or null to deregister. |
Definition at line 123 of file BasicMessageChannel.java.
|
inlinestatic |
Toggles whether the channel should show warning messages when discarding messages due to overflow. When 'warns' is false the channel is expected to overflow and warning messages will not be shown.
Definition at line 188 of file BasicMessageChannel.java.
|
inline |
Toggles whether the channel should show warning messages when discarding messages due to overflow. When 'warns' is false the channel is expected to overflow and warning messages will not be shown.
Definition at line 150 of file BasicMessageChannel.java.
|
static |
Definition at line 33 of file BasicMessageChannel.java.