unsubscribe method

Future<void> unsubscribe([
  1. String topic = ""
])

Unsubscribe from all subscriptions of the specified topic ("*" or record id).

If topic is not set, then this method will unsubscribe from all subscriptions associated to the current collection.

Implementation

Future<void> unsubscribe([String topic = ""]) {
  if (topic.isNotEmpty) {
    return client.realtime.unsubscribe("$_collectionIdOrName/$topic");
  }

  return client.realtime.unsubscribeByPrefix(_collectionIdOrName);
}