showChallenge method

void showChallenge(
  1. BuildContext context,
  2. Response response,
  3. ValueChanged<String> onCaptchaResolved
)

Implementation

void showChallenge(BuildContext context, Response response,
    ValueChanged<String> onCaptchaResolved) {
  DataDomeLogger.info('Presenting the captcha');

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