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

A Flutter package for generating clear and customizable CAPTCHA images to enhance security in applications.

Clear Captcha #

A Flutter package to generate and display CAPTCHA images in your application. This package allows for customizable CAPTCHA images with different settings for dimensions, colors, and text.

Features #

  • Generate random CAPTCHA images with customizable length, width, height, background color, and text color.
  • Option to refresh the CAPTCHA image with an icon.
  • Simple integration into your Flutter application.

Installation #

To use this package, add clear_captcha to your pubspec.yaml file:

dependencies:
  clear_captcha: ^1.0.0

Then run:

flutter pub get

Usage #

Import the package in your Dart file:

import 'package:clear_captcha/clear_captcha.dart';

Example #

Here is a basic example of how to use the ClearCaptcha widget:

import 'package:flutter/material.dart';
import 'package:clear_captcha/clear_captcha.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Clear Captcha Example'),
        ),
        body: Center(
          child: ClearCaptcha(
            captchaLenght: 6, // Length of the CAPTCHA
            captchaWidth: 300, // Width of the CAPTCHA image
            captchaHeight: 100, // Height of the CAPTCHA image
            backgroundColor: Colors.lightBlueAccent, // Background color
            captchaTextColor: Colors.white, // CAPTCHA text color
            cornerRadius: 15.0, // Corner radius for the CAPTCHA background
            iconColor: Colors.red, // Icon color for refresh button
            iconSize: 30.0, // Size of the refresh icon
            refreshIcon: Icons.refresh, // Icon for refreshing CAPTCHA
            onCaptchValue: (value) {
              // Handle the generated CAPTCHA value
              print('Generated CAPTCHA: $value');
            },
          ),
        ),
      ),
    );
  }
}

CAPTCHA Example Images #

Here are some example CAPTCHA images generated by the package:

CAPTCHA Example 1

CAPTCHA Example 2

CAPTCHA Example 3

Parameters #

  • captchaLenght: int? - Length of the generated CAPTCHA string. Default is 5.
  • captchaWidth: int? - Width of the CAPTCHA image. Default is 200.
  • captchaHeight: int? - Height of the CAPTCHA image. Default is 100.
  • backgroundColor: Color? - Background color of the CAPTCHA image. Default is Colors.white.
  • captchaTextColor: Color? - Color of the CAPTCHA text. Default is Colors.black.
  • cornerRadius: double? - Corner radius for the CAPTCHA background. Default is 20.0.
  • iconColor: Color? - Color of the refresh icon. Default is Colors.black.
  • iconSize: double? - Size of the refresh icon. Default is 40.0.
  • refreshIcon: IconData? - Icon data for the refresh button. Default is Icons.autorenew.
  • isIcon: bool? - Whether to show the refresh icon. Default is true.
  • onCaptchValue: Function(String)? - Callback function that returns the generated CAPTCHA string.

Contribution #

Contributions are welcome! Please feel free to contact this mubeenofficial01@gmail.com

License #

This project is licensed under the MIT License. See the LICENSE file for details.

1
likes
120
points
16
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package for generating clear and customizable CAPTCHA images to enhance security in applications.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on clear_package