clear method

void clear({
  1. bool unnamedOnly = false,
})

Clears the subscription set. If unnamedOnly is true, then only unnamed subscriptions will be removed.

Implementation

void clear({bool unnamedOnly = false}) {
  if (unnamedOnly) {
    for (var i = length - 1; i >= 0; i--) {
      final subscription = this[i];
      if (subscription.name == null) {
        remove(subscription);
      }
    }
  } else {
    realmCore.clearSubscriptionSet(this);
  }
}