send method Null safety

void send(
  1. dynamic data
)

Implementation

void send(dynamic data) {
	if (data is PackMeMessage) data = _packMe.pack(data);
	else if (data is! Uint8List && data is! String) {
		onError?.call('Unsupported data type for Client.send(), only PackMeMessage, Uint8List and String are supported');
		return;
	}
	if (data != null && socket.state == WebSocket.open) socket.add(data);
}