Sends message to and receives messages from the underlying platform.

Static Methods

handlePlatformMessage(String channel, ByteData data, PlatformMessageResponseCallback callback) Future<Null>

Calls the handler registered for the given channel.

invokeMethod(String channel, String method, [ List args = const [] ]) Future

sendBinary(String channel, ByteData message) Future<ByteData>

Send a binary message to the host application.

sendJSON(String channel, json) Future

Sends a JSON-encoded message to the host application and JSON-decodes the response.

sendString(String channel, String message) Future<String>

Send a string message to the host application.

setBinaryMessageHandler(String channel, Future<ByteData> handler(ByteData message)) → void

Set a callback for receiving binary messages from the platform.

setJSONMessageHandler(String channel, Future handler(message)) → void

Set a callback for receiving JSON messages from the platform.

setMockBinaryMessageHandler(String channel, Future<ByteData> handler(ByteData message)) → void

Sets a message handler that intercepts outgoing messages in binary form.

setMockJSONMessageHandler(String channel, Future handler(message)) → void

Sets a message handler that intercepts outgoing messages in JSON form.

setMockStringMessageHandler(String channel, Future<String> handler(String message)) → void

Sets a message handler that intercepts outgoing messages in string form.

setStringMessageHandler(String channel, Future<String> handler(String message)) → void

Set a callback for receiving string messages from the platform.

Properties

hashCode int

Get a hash code for this object.

read-only, inherited
runtimeType Type

A representation of the runtime type of the object.

read-only, inherited

Operators

operator ==(other) bool

The equality operator.

inherited

Methods

noSuchMethod(Invocation invocation) → dynamic

Invoked when a non-existent method or property is accessed.

inherited
toString() String

Returns a string representation of this object.

inherited