flutter_recaptcha 0.1.0
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:
CaptchaWidgetno longer takes a pre-builttextField. Instead, pass an optionalcontrollerand customize the field viadecoration,labelText, andhintText. The widget now builds and disposes its ownTextEditingControllerwhen one isn't supplied. - Added
CaptchaStyleType, an enum of 8 built-in visual designs:classic,modern,minimalist,dark,neon,playful,ocean, andsunset. - 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 acopyWithfor fine-tuning. Pass a custom instance viathemefor full control, bypassingstyleentirely. - Added
CaptchaCharacterType, an enum selecting which characters populate the challenge:numbersOnly,lettersOnly, oralphanumeric(default). - Added
lengthto control how many characters are generated, andexcludeAmbiguousCharacters(defaulttrue) to drop visually confusable glyphs (0/O,1/l/I, ...). - Added
caseSensitive(defaultfalse) 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 newclearFieldOnRegenerateflag (defaulttrue). Auto-regeneration on failure remains configurable viaautoRegenerateOnFailure. - 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()onCaptchaWidgetState, so verification can be triggered from outside the widget (e.g. a form-level submit button) in addition toregenerate(). - The widget is now wrapped in a themed card (background, border radius,
shadow) by default; disable with
showCard: falseto embed it directly in your own container. CaptchaPainternow scales the background image to the canvas size instead of assuming a fixed size, and supports an optional glow color used by theneonstyle.
0.0.3 #
CaptchaWidgetState.regenerate()is now public, so a new CAPTCHA can be requested externally via aGlobalKey<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, aCustomPainterused 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.