搜尋套件、儲存庫與 APP 分類

套件詳情v0.1.0

flutter_recaptcha_v2

一個用於 Google ReCaptcha V2 的 Flutter 外掛程式。

近 30 天下載
68
喜歡數
39
Pub 分數
15

安裝套件

flutter pub add flutter_recaptcha_v2

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個將 Google ReCaptcha V2 結合到行動應用程式中的 Flutter 外掛程式,讓開發者能夠為表單和登入流程加入機器人防護。它提供簡單介面,可在 Android 與 iOS 平台上呈現與驗證 reCAPTCHA 挑戰。該外掛程式處理與 Google reCAPTCHA 服務的底層通訊,確保使用者互動的安全驗證。設計上注重易用性,支援非同步驗證並傳回金鑰供伺服器端驗證。

適用情境

  • 保護登入表單免受機器人攻擊
  • 保護聯絡表單提交
  • 防止自動帳戶創建
  • 增強註冊工作流程中的安全性
  • 驗證敏感操作中的使用者動作

主要特色

  • 與 Flutter 應用的簡單整合
  • 支援 reCAPTCHA V2 隱式和常規類型
  • 返回驗證令牌以供伺服器驗證
  • 跨平台相容性(Android 與 iOS)
  • 非同步驗證工作流程

適合對象

  • 開發安全的身份驗證流程的開發者
  • 需要在表單上進行機器人保護的應用程式
  • 需要遵守反濫用措施的項目
  • 將 Google 的 reCAPTCHA 服務整合到 Flutter 中的 Teams
  • 行動應用程式有高度自動濫用風險

使用建議

  • 需要互聯網連接以進行 reCAPTCHA 驗證
  • 伺服器端令牌驗證是強制性的
  • 如果實施不當,可能會影響使用者體驗
  • 依賴外部谷歌服務的可用性
  • 僅限 reCAPTCHA V2,不包含 V3 或更新版本

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

flutter_recaptcha_v2

A Flutter plugin for Google ReCaptcha V2.

Getting Started

This plugin requires Webview to use Google ReCaptcha. This plugin only supports Google ReCAPTCHA V2 (not V3)

Obtain your own key & secret here: https://www.google.com/recaptcha

!!! Remember to add this domain into the reCaptcha setting or add your own domain: recaptcha-flutter-plugin.firebaseapp.com

Then test your API KEY at: https://recaptcha-flutter-plugin.firebaseapp.com/?api_key=API_KEY

Put RecaptchaV2 widget into your widget tree (Usually inside Stack widget), make sure it's placed on top of the tree and block all the behind interactions:

  • You can change the plugin url for the captcha domain insde the RecaptchaV2 or leave it by default non adding the line:
pluginURL: "https://mypersonalurl.com"

if you have setted your own domain, specify the domain used

  • To show the Cancel Button with the captcha controller set the boolean to true:
visibleCancelBottom: true

otherwise it won't appear

  • Set the Text for the Cancel buttom or leave it by default:
textCancelButtom: "CANCEL CAPTCHA"
Example
RecaptchaV2Controller recaptchaV2Controller = RecaptchaV2Controller();
...
RecaptchaV2(
    apiKey: "YOUR_API_KEY", // for enabling the reCaptcha
    apiSecret: "YOUR_API_SECRET", // for verifying the responded token
    pluginURL: "https://mypersonalurl.com",
	visibleCancelBottom: true,
	textCancelButtom: "CUSTOM CANCEL CAPTCHA BUTTOM TEXT",
	controller: recaptchaV2Controller,
    onVerifiedError: (err){
        print(err);
    },
    onVerifiedSuccessfully: (success) {
        setState(() {
            if (success) {
                // You've been verified successfully.
            } else {
                // "Failed to verify.
            }
        });
    },
),

The RecaptchaV2 widget is hidden by default, you need to attach the RecaptchaV2Controller and call show() method when needed. Like this:

recaptchaV2Controller.show();

Manually hide it:

recaptchaV2Controller.hide();

That's it!

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

暫無相關資料。