ArCaptchaController class

Controller for displaying and managing ArCaptcha widgets across different UI modes (CaptchaType.dialog, CaptchaType.screen, CaptchaType.modalBottomSheet, or CaptchaType.responsiveDialog).

Constructors

ArCaptchaController({required String siteKey, String lang = 'en', String domain = 'localhost', String onErrorMessage = 'Something went wrong, try again!', int errorPrint = 0, double captchaWidth = 550, double captchaHeight = 550, Color color = Colors.black, ThemeMode theme = ThemeMode.light, DataSize dataSize = DataSize.normal, bool dialogBarrierDismissible = true, double maxResponsiveDialogWidth = 600, bool needToShowLoadingOverlay = true, String? loadingOverlayText = 'Loading captcha ...', bool useInAppWebViewOnWeb = false, bool enableDebugLogging = false})
Constructor initializes required fields and builds the HTML section.

Properties

captchaHeight double
The height of the captcha widget container.
final
captchaWidth double
The width of the captcha when modes is CaptchaType.dialog
final
color Color
Set color of every colored element in widget. Like checkbox color See supported color in colorToString() function
final
dataSize DataSize
Controls the display mode of the captcha checkbox.
final
dialogBarrierDismissible bool
Dialog parameters
final
domain String
The domain name of the app (default: localhost). If use in production mood you should pass domain Url
final
enableDebugLogging bool
final
errorPrint int
Controls whether error messages appear below the captcha checkbox.
final
hashCode int
The hash code for this object.
no setterinherited
lang String
The language code (en or fa).
final
loadingOverlayText String?
Show overlay Text loading before captcha loaded
final
maxResponsiveDialogWidth double
The maximum width of the responsive dialog. Defaults to 600 if not set. This is used to limit the width of the responsive dialog.
final
needToShowLoadingOverlay bool
Show overlay loading before captcha loaded
final
onErrorMessage String
Default error message when captcha fails.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
siteKey String
Your ArCaptcha site key (required).
final
theme ThemeMode
The theme mode (light or dark).
final
useInAppWebViewOnWeb bool
Uses flutter_inappwebview for the web captcha surface when running on web. Defaults to false to preserve the current HtmlElementView-based behavior.
final

Methods

colorToString(Color color) String
Converts a Color object to a CSS-compatible hex color string in the format #RRGGBB.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
showCaptcha({required BuildContext context, required CaptchaParams params}) Future<String?>
Shows the captcha widget in the chosen mode.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Properties

enableModalDrag bool?
Controls whether the modal bottom sheet can be dragged Defaults to true if not set.
getter/setter pair
getMaxResponsiveDialogWidth double
Get the maximum width of the responsive dialog.
no setter
isModalDismissible bool?
Controls whether the modal bottom sheet can be dismissed
getter/setter pair
webViewController ↔ WebViewController?
Controller used for webview_flutter (mobile).
getter/setter pair