ArCaptchaController constructor

ArCaptchaController({
  1. required String siteKey,
  2. String lang = 'en',
  3. String domain = 'localhost',
  4. String onErrorMessage = 'Something went wrong, try again!',
  5. int errorPrint = 0,
  6. double captchaWidth = 550,
  7. double captchaHeight = 550,
  8. Color color = Colors.black,
  9. ThemeMode theme = ThemeMode.light,
  10. DataSize dataSize = DataSize.normal,
  11. bool dialogBarrierDismissible = true,
  12. double maxResponsiveDialogWidth = 600,
  13. bool needToShowLoadingOverlay = true,
  14. String? loadingOverlayText = 'Loading captcha ...',
  15. bool useInAppWebViewOnWeb = false,
  16. bool enableDebugLogging = false,
})

Constructor initializes required fields and builds the HTML section.

Implementation

ArCaptchaController({
  required this.siteKey,
  this.lang = 'en',
  this.domain = 'localhost',
  this.onErrorMessage = 'Something went wrong, try again!',
  this.errorPrint = 0,
  this.captchaWidth = 550,
  this.captchaHeight = 550,
  this.color = Colors.black,
  this.theme = ThemeMode.light,
  this.dataSize = DataSize.normal,
  this.dialogBarrierDismissible = true,
  this.maxResponsiveDialogWidth = 600,
  this.needToShowLoadingOverlay = true,
  this.loadingOverlayText = 'Loading captcha ...',
  this.useInAppWebViewOnWeb = false,
  this.enableDebugLogging = false,
}) {
  _log(
    'created domain=$domain siteKeyConfigured=${siteKey.isNotEmpty} '
    'lang=$lang dataSize=${dataSize.name} theme=${theme.name} '
    'captcha=${captchaWidth}x$captchaHeight '
    'webMode=${useInAppWebViewOnWeb ? "inappwebview" : "html-element"}',
  );

  _htmlContent = _buildHtmlSection();
}