updateTopicSubscription method

Future<void> updateTopicSubscription(
  1. String topic,
  2. {bool enabled = true}
)

Subscribes or unsubscribes from topic based on the enabled parameter.

Implementation

Future<void> updateTopicSubscription(
  String topic, {
  bool enabled = true,
}) async {
  if (kIsWeb) return;
  enabled
      ? instance.subscribeToTopic(topic)
      : instance.unsubscribeFromTopic(topic);
}