unsubscribe method

Future<void> unsubscribe({
  1. String? orgId,
})

Unsubscribes from current subscription asynchronously Sets loading state and invokes the provider method

Implementation

Future<void> unsubscribe({
  String? orgId,
}) async {
  emit(state.startLoading(BillingLoadingStates.unsubscribe));

  try {
    return await provider.unsubscribe(
      orgId: orgId,
    );
  } catch (error, stackTrace) {
    emit(state.addMessage(
      Message.error(_localizations.unknownError),
      error,
      stackTrace,
    ));
    rethrow;
  } finally {
    emit(state.endLoading(BillingLoadingStates.unsubscribe));
  }
}