cancelAll method Null safety

void cancelAll()

Cancel all StreamSubscriptions and remove them from the list

For example:

subxMap.cancelAll();

Implementation

void cancelAll() async {
  _subscriptionMap.forEach((
    Object key,
    StreamSubscription<dynamic> subscription,
  ) {
    subscription.cancel();
  });

  _subscriptionMap.clear();
}