Reputation: 43
I am completely stuck on how to implement RECAPTCHA with flutter_web.
The current available plugins (https://pub.dev/packages/recaptchav2_plugin and https://pub.dev/packages/flutter_recaptcha_v2) do not support web.
Upvotes: 2
Views: 2485
Reputation: 819
Below are the major steps to test the g_recaptcha_v3
package extracted from the article implementation of Google reCAPTCHA v3 in Flutter Web.
pubspec
packages. # A composable, Future-based library for making HTTP requests.
http: ^0.13.4
# A Google reCAPTCHA is a free service that protects your website from spam and abuse.
g_recaptcha_v3: ^0.0.4
web
folder, open the index.html
file and paste the below script inside the <body>
tag.<script src="https://www.google.com/recaptcha/api.js?render=recaptcha-site-key"></script>
GRecaptchaV3.ready
in the main
method and run the app.void main() async {
WidgetsFlutterBinding.ensureInitialized();
await GRecaptchaV3.ready('recaptcha-site-key');
runApp(const MyApp());
}
Upvotes: 1