angular_grecaptcha 0.0.4

  • Readme
  • Changelog
  • Installing
  • 0

AngularDart Google ReCaptcha component #

Installation #

Put following lines in pubspec.yaml:

dependencies:
  angular_grecaptcha: ^0.0.4

then

pub get

Basic usage #

import 'package:angular_grecaptcha/angular_grecaptcha.dart';
...
@Component(
  selector: 'my-component',
  template: '''
    ...
    <form>
    ...
    <g-recaptcha sitekey="YOUR SITEKEY"></g-recaptcha>
    ...
    </form>
    ...
  ''',
  directives: const [AngularRecaptcha]
)
class MyComponent {}

Besides mandatory sitekey parameter you can add optional render parameters:

  • sitekey: String -- Your sitekey
  • theme: String -- Optional. The color theme of the widget. Values: light | dark. Default: light.
  • type: String -- Optional. The type of CAPTCHA to serve. Values: audio | image. Default: image.
  • size: String -- Optional. The size of the widget. Values: compact | normal. Default: normal.
  • tabindex: int -- Optional. The tabindex of the widget and challenge. If other elements in your page use tabindex, it should be set to make user navigation easier. Default: 0
  • callback: Function -- Optional. The name of your callback function to be executed when the user submits a successful CAPTCHA response. The user's response, g-recaptcha-response, will be the input for your callback function.
  • expired-callback: Function -- Optional. The name of your callback function to be executed when the recaptcha response expires and the user needs to solve a new CAPTCHA.

Original parameters description you can find here

Advanced usage example #

Advanced usage example you can find here

Important information #

This component allows to get ReCaptcha response and post it to a back-end server, where the response is to be verified as described here. The component is not responsible for the verification.

0.0.4 #

Added grecaptcha.execute() support

0.0.3 #

Fixed the bug when the ReCaptcha was not rendered after navigating via an Angular Routing Link to a component containing the ReCaptcha

0.0.2 #

  • Now api.js is loaded automatically only if it has not been loaded before
  • A little refactoring
  • Enhanced documentation
  • Several bug fixes

0.0.1 #

AngularDart Google ReCaptcha component released

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  angular_grecaptcha: ^0.0.4

2. Install it

You can install packages from the command line:

with pub:


$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:angular_grecaptcha/angular_grecaptcha.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
--
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
--
Overall:
Weighted score of the above. [more]
0
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://dart.dev/dart-2#migration.

Maintenance issues and suggestions

Make sure dartdoc successfully runs on your package's source files. (-10 points)

Dependencies were not resolved.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.8.0 <2.0.0