cloudflare_turnstile 0.1.1 copy "cloudflare_turnstile: ^0.1.1" to clipboard
cloudflare_turnstile: ^0.1.1 copied to clipboard

The Cloudflare Turnstile Widget is an unofficial Flutter package designed to seamlessly integrate Cloudflare's Turnstile functionality into your Flutter applications.

Flutter Cloudflare Turnstile Pub #

Cloudflare turnstile is a free CAPTCHAs Alternative, Turnstile delivers frustration-free, CAPTCHA-free web experiences to website visitors - with just a simple snippet of free code. Moreover, Turnstile stops abuse and confirms visitors are real without the data privacy concerns or awful user experience of CAPTCHAs.

Preview

⚠️ NOTE #

This package is unofficial and not endorsed by Cloudflare. Use it at your own discretion.

Installation #

flutter pub add cloudflare_turnstile

Example #

Here`s a quick example that show how to add Cloudflare Turnstile widget to your flutter app

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

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: CloudFlareTurnstile(
          siteKey: '0x0000000000000000000000', //Change with your site key
          baseUrl: 'http://localhost/',
          onTokenRecived: (token) {
            print(token);
          },
        ),
      ),
    );
  }
}

For Android and iOS platforms you need to provide the baseUrl parameter with the actual URL of your Turnstile Site list. if you don't have a website, you can add the application package name to the Turnstile widget domains list in your Cloudflare Dashboard. Then the baseUrl should look like baseUrl: 'http://com.example.app' or baseUrl: 'http://mywebsite.com/'.

Configure Turnstile Widget #

final TurnstileOptions options = const TurnstileOptions(
  mode: TurnstileMode.managed,
  size: TurnstileSize.normal,
  theme: TurnstileTheme.light,
  language: 'ar',
  retryAutomatically: false,
  refreshTimeout: TurnstileRefreshTimeout.manual,
);

//...

CloudflareTurnstile(
  sitekey: '0x0000000000000000000000',
  options: options,
);

License #

This project is licensed under the MIT License - see the LICENSE.md file for details.

39
likes
0
points
17k
downloads

Publisher

unverified uploader

Weekly Downloads

The Cloudflare Turnstile Widget is an unofficial Flutter package designed to seamlessly integrate Cloudflare's Turnstile functionality into your Flutter applications.

Repository (GitHub)
View/report issues

Topics

#hcaptcha #recaptcha #cloudflare-turnstile

License

unknown (license)

Dependencies

flutter, flutter_inappwebview_android, flutter_inappwebview_ios, flutter_inappwebview_platform_interface

More

Packages that depend on cloudflare_turnstile