loadConsentForm static method

void loadConsentForm({
  1. dynamic onCheckedStatus(
    1. ConsentStatus status
    )?,
  2. dynamic onError(
    1. FormError
    )?,
})

Implementation

static void loadConsentForm({Function(ConsentStatus status)? onCheckedStatus, Function(FormError)? onError}) {
  ConsentForm.loadConsentForm(
        (consentForm) async {
          final status = await ConsentInformation.instance.getConsentStatus();
          if (status == ConsentStatus.required) {
            consentForm.show((formError) {
              if (formError != null) {
                onError?.call(formError);
              }

              loadConsentForm(onCheckedStatus: onCheckedStatus, onError: onError);
            });
          } else {
            onCheckedStatus?.call(status);
          }
        },
        (formError) => onError?.call(formError),
  );
}