subscribe method
Subscribe to a given topic.
Implementation
void subscribe({required String topic}) {
final data = {
'topic': topic,
'type': 'sub',
'payload': '',
'silent': true,
};
final message = json.encode(data);
_socket?.send(message);
}