addHalf method Null safety

MqttClientPayloadBuilder addHalf(
  1. int val
)

Add a half word, 16 bits, this will overflow on values > 2**16-1

Implementation

MqttClientPayloadBuilder addHalf(int val) {
  final tmp = Uint16List.fromList(<int>[val]);
  _payload!.addAll(tmp.buffer.asInt8List());
  return this;
}