local_captcha 1.0.0 copy "local_captcha: ^1.0.0" to clipboard
local_captcha: ^1.0.0 copied to clipboard

outdated

A fake captcha widget that helps speed up the development of prototype/demo app.

Flutter Local Captcha #

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.

Features #

  • Light weight, pure dart.
  • Easy to use. Highly customizable.

Live Preview #

Website Demo

Installation #

dependencies:
  local_captcha: ^1.0.0

Import #

import 'package:local_captcha/local_captcha.dart';

Usage #

The controller

// Init controller.
final _localCaptchaController = LocalCaptchaController();

// Validate captcha code.
_localCaptchaController.validate(value);

// Refresh captcha code.
_localCaptchaController.refresh();

// Remember to dispose controller when you no longer need it.
@override
void dispose() {
  _localCaptchaController.dispose();

  super.dispose();
}

The widget

LocalCaptcha(
  key: ValueKey('to tell widget should update'),
  controller: _localCaptchaController,
  height: 150,
  width: 300,
  backgroundColor: Colors.grey[100]!,
  chars: 'abdefghnryABDEFGHNQRY3468',
  length: 5,
  fontSize: 80.0,
  caseSensitive: false,
  codeExpireAfter: Duration(minutes: 10),
);

Example #

See the complete example at ./example/main.dart file.

11
likes
0
points
2.3k
downloads

Publisher

unverified uploader

Weekly Downloads

A fake captcha widget that helps speed up the development of prototype/demo app.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on local_captcha