A named channel for communicating with platform plugins using asynchronous message passing.
Messages are encoded into binary before being sent, and binary messages
received are decoded into Dart values. The MessageCodec used must be
compatible with the one used by the platform plugin. This can be achieved
by creating a basic message channel counterpart of this channel on the
platform side. The Dart type of messages sent and received is
but only the values supported by the specified MessageCodec can be used.
The use of unsupported values should be considered programming errors, and
will result in exceptions being thrown. The null message is supported
for all codecs.
The logical identity of the channel is given by its name. Identically named channels will interfere with each other's communication.
All BasicMessageChannels provided by the Flutter framework guarantee FIFO ordering. Applications can assume messages sent via a built-in BasicMessageChannel are delivered in the same order as they're sent.
- Available Extensions
- binaryMessenger → BinaryMessenger
The messenger which sends the bytes for this channel, not null.
The message codec used by this channel, not null.
- hashCode → int
The hash code for this object. [...]
- name → String
The logical channel on which communication happens, not null.
- runtimeType → Type
A representation of the runtime type of the object.
Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
T message) → Future< T?>
Sends the specified
messageto the platform plugins on this channel. [...]
Future< T>handler(T? message)?) → void
- Sets a callback for receiving messages from the platform plugins on this channel. Messages may be null. [...]
) → String
A string representation of this object. [...]