showCaptcha method

  1. @Deprecated("Please use showChallenge method instead")
void showCaptcha(
  1. BuildContext context,
  2. String captchaUrl,
  3. ValueChanged<String> onCaptchaResolved
)

Implementation

@Deprecated("Please use showChallenge method instead")
void showCaptcha(BuildContext context, String captchaUrl,
    ValueChanged<String> onCaptchaResolved) {
  DataDomeLogger.info('Presenting the captcha');

  var isValideUrl = Uri.tryParse("htps")?.hasAbsolutePath ?? false;
  if (!isValideUrl) {
    DataDomeLogger.error(
        "Please use showChallenge method instead to support HTML response");
    return;
  }

  isDisplayed = true;
  showGeneralDialog(
    context: context,
    barrierDismissible: false,
    pageBuilder: (context, __, ___) {
      dialogContext = context;
      return new CaptchaPage.challengeFromCaptchaUrl(
          captchaUrl: captchaUrl,
          onCaptchaResolved: (value) {
            DataDomeDio.storeCookie(value);
            dismissCaptcha();
            onCaptchaResolved(value);
          });
    },
  );
}