LocalCaptcha class

This is a fake captcha widget that helps speed up the development of prototype/demo app.

This captcha widget is designed to work locally, with minimum setup, and with basic functions like a real captcha.

This is NOT a real anti-bot solution and is NOT recommended to use in production app.

Inheritance

Constructors

LocalCaptcha({Key? key, required LocalCaptchaController controller, String chars = 'abdefghnryABDEFGHNQRY3468', int length = 5, required double height, required double width, double? fontSize, Color backgroundColor = Colors.white, List<Color>? textColors, List<Color>? noiseColors, bool caseSensitive = false, Duration codeExpireAfter = const Duration(minutes: 10), dynamic onCaptchaGenerated(String)?})
const

Properties

backgroundColor → Color
Background color of captcha widget.
final
caseSensitive → bool
Condition for code validation.
final
chars → String
Characters to show in captcha.
final
codeExpireAfter → Duration
Condition for code validation.
final
controller → LocalCaptchaController
The controller for LocalCaptcha.
final
fontSize → double?
Font size of captcha.
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
Height of captcha widget, cannot greater than width.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
length → int
Length of characters to show in captcha.
final
noiseColors → List<Color>?
List of colors to use on captcha noise layer.
final
onCaptchaGenerated → dynamic Function(String)?
Value of captcha when it's generated.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
textColors → List<Color>?
List of colors to use on captcha text layer.
final
width → double
Width of captcha widget, cannot less than height.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<LocalCaptcha>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() → List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) → String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String
Returns a one-line detailed description of the object.
inherited
toStringShort() → String
A short, textual description of this widget.
inherited

Operators

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