send method

  1. @override
Future<ByteData> send (
  1. String channel,
  2. ByteData message

Send a binary message to the platform plugins on the given channel.

Returns a Future which completes to the received response, undecoded, in binary form.


Future<ByteData> send(String channel, ByteData message) {
  final Future<ByteData> resultFuture = delegate.send(channel, message);
  // Removes the future itself from the [_pendingMessages] list when it
  // completes.
  if (resultFuture != null) {
    resultFuture.whenComplete(() => _pendingMessages.remove(resultFuture));
  return resultFuture;