readFrom method Null safety

  1. @override
void readFrom(
  1. MqttByteBuffer payloadStream

Creates a payload from the specified header stream.


void readFrom(MqttByteBuffer payloadStream) {
  // The payload of the publish message is not a string, just
  // a binary chunk of bytes.
  // The length of the bytes is the length specified in the header,
  // minus any bytes spent in the variable header.
  final messageBytes = header!.messageSize - variableHeader!.length;
  message =;