Flutter Engine
The Flutter Engine
Public Member Functions | List of all members
io.flutter.plugin.common.BasicMessageChannel< T >.MessageHandler< T > Interface Template Reference

Public Member Functions

void onMessage (@Nullable T message, @NonNull Reply< T > reply)
 

Detailed Description

A handler of incoming messages.

Definition at line 199 of file BasicMessageChannel.java.

Member Function Documentation

◆ onMessage()

void io.flutter.plugin.common.BasicMessageChannel< T >.MessageHandler< T >.onMessage ( @Nullable T  message,
@NonNull Reply< T reply 
)

Handles the specified message received from Flutter.

Handler implementations must reply to all incoming messages, by submitting a single reply message to the given Reply. Failure to do so will result in lingering Flutter reply handlers. The reply may be submitted asynchronously and invoked on any thread.

Any uncaught exception thrown by this method, or the preceding message decoding, will be caught by the channel implementation and logged, and a null reply message will be sent back to Flutter.

Any uncaught exception thrown during encoding a reply message submitted to the Reply is treated similarly: the exception is logged, and a null reply is sent to Flutter.

Parameters
messagethe message, possibly null.
replya Reply for sending a single message reply back to Flutter.

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