setDelegate method

void setDelegate(
  1. AppDNABillingDelegate? delegate
)

Set a delegate to receive billing lifecycle callbacks (purchases, failures, entitlement changes, restores, billing-unavailable). Pass null to clear the current delegate and stop listening.

Implementation

void setDelegate(AppDNABillingDelegate? delegate) {
  _delegate = delegate;
  _delegateSub?.cancel();
  _delegateSub = null;
  if (delegate == null) return;
  _delegateSub = _delegateChannel.receiveBroadcastStream().listen(_dispatch);
}