flutter_recaptcha 0.1.0 copy "flutter_recaptcha: ^0.1.0" to clipboard
flutter_recaptcha: ^0.1.0 copied to clipboard

A professional, fully themeable Flutter CAPTCHA widget with 8 built-in designs, numeric/alphabetic/alphanumeric modes, and zero external dependencies.

0.1.0 #

A professional redesign of the widget's theming and configuration surface.

  • Breaking: CaptchaWidget no longer takes a pre-built textField. Instead, pass an optional controller and customize the field via decoration, labelText, and hintText. The widget now builds and disposes its own TextEditingController when one isn't supplied.
  • Added CaptchaStyleType, an enum of 8 built-in visual designs: classic, modern, minimalist, dark, neon, playful, ocean, and sunset.
  • Added CaptchaThemeData, an immutable value object holding every visual variable (colors, noise density, distortion lines, rotation, border radius, shadows, glow) with a factory constructor per style and a copyWith for fine-tuning. Pass a custom instance via theme for full control, bypassing style entirely.
  • Added CaptchaCharacterType, an enum selecting which characters populate the challenge: numbersOnly, lettersOnly, or alphanumeric (default).
  • Added length to control how many characters are generated, and excludeAmbiguousCharacters (default true) to drop visually confusable glyphs (0/O, 1/l/I, ...).
  • Added caseSensitive (default false) to control whether verification matching is case-sensitive.
  • The input field is now automatically cleared whenever a new CAPTCHA is generated — after a failed attempt, on refresh, or via a programmatic regenerate() call — controlled by the new clearFieldOnRegenerate flag (default true). Auto-regeneration on failure remains configurable via autoRegenerateOnFailure.
  • Added onChallengeGenerated, a callback fired with the new plain-text answer every time a challenge is (re)generated — useful for logging or server-side verification hooks.
  • Added verify() on CaptchaWidgetState, so verification can be triggered from outside the widget (e.g. a form-level submit button) in addition to regenerate().
  • The widget is now wrapped in a themed card (background, border radius, shadow) by default; disable with showCard: false to embed it directly in your own container.
  • CaptchaPainter now scales the background image to the canvas size instead of assuming a fixed size, and supports an optional glow color used by the neon style.

0.0.3 #

  • CaptchaWidgetState.regenerate() is now public, so a new CAPTCHA can be requested externally via a GlobalKey<CaptchaWidgetState>.
  • Background CAPTCHA images are now properly disposed (ui.Image.dispose()) when a new CAPTCHA is generated or the widget is removed, preventing a memory leak on repeated regeneration.
  • Internal cleanup: doc comments added to all public API members, magic numbers replaced with named constants, and an internal relative import used instead of a package: self-import.

0.1.0 #

Initial release.

  • Added CaptchaWidget, a self-contained widget that renders a distorted, noisy CAPTCHA image and a text field for validation.
  • Added CaptchaPainter, a CustomPainter used to draw the CAPTCHA text with random angles over a noisy background.
  • Added an auto-regenerate refresh button and a manual "refresh" callback via onVerified.
4
likes
160
points
189
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

A professional, fully themeable Flutter CAPTCHA widget with 8 built-in designs, numeric/alphabetic/alphanumeric modes, and zero external dependencies.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter

More

Packages that depend on flutter_recaptcha