simpleCheckAndLoadForm static method

void simpleCheckAndLoadForm({
  1. required ConsentRequestParameters params,
  2. dynamic onCheckedStatus(
    1. ConsentStatus status
    )?,
  3. dynamic onError(
    1. FormError
    )?,
})

Implementation

static void simpleCheckAndLoadForm({
  required ConsentRequestParameters params,
  Function(ConsentStatus status)? onCheckedStatus,
  Function(FormError)? onError,
}) {
  checkConsentFormAvailable(
    params: params,
    onCheckFinished: (isFormAvailable) {
      if (isFormAvailable) {
        loadConsentForm(
          onCheckedStatus: onCheckedStatus,
          onError: onError,
        );
      } else {
        onCheckedStatus?.call(ConsentStatus.obtained);
      }
    },
    onError: onError,
  );
}