unsubscribe method

Future<void> unsubscribe(
  1. String topic
)

Unsubscribe from a topic

Implementation

Future<void> unsubscribe(String topic) async {
  try {
    if (!_container.isRegistered(PubSubHandler)) return;
    await _container.get<PubSubHandler>().unsubscribe(topic);
  } catch (e) {
    _logger.error('Failed to unsubscribe: $e');
  }
}