angular_recaptcha 0.1.3

Angular Recaptcha (Dart) #

How to use #

Add to pubspec.yaml #

# If you are running angular `v5`
angular_recaptcha: ^0.1.1
# If you are still running angular `v4`
# angular_recaptcha: ^0.0.8
# If you are still running angular `v2` or `v3`,
# then you need to use: 
# angular_recaptcha: "0.0.6"` 

then

pub get

Add to index.html #

Deprecated Adding the script tag is no more necessary

<script src="https://www.google.com/recaptcha/api.js?render=explicit"></script>

Use it #

<angular-recaptcha [(ngModel)]="value" key="YOUR_KEY" auto-render></angular-recaptcha>

Options #

Support ngModel for Form validation.

@Inputs #

  • String size: Support "normal" or "compact"
  • String key: Your sitekey
  • String theme: Support "light" or "dark"
  • String type: Support "image" or "audio"
  • bool autoRender: will render the captchat automatically when ready
  • String tabindex

@Outputs #

  • expire: notify when the token is expired, we also set value to null

Getter #

  • value: get the value of the captcha

Functions #

  • render(): manually render the captcha
  • reset(): manually reset the captcha

More documentations

More #

import 'package:angular/angular.dart';
import 'package:angular_recaptcha/angular_recaptcha.dart';

@Component(
    selector: 'app',
    template: '''
        <angular-recaptcha [(ngModel)]="value" key="YOUR_KEY" [(ngModel)]="value" auto-render></angular-recaptcha>
        ''',
    directives: const [AngularRecaptcha, formDirectives ]
)
class AppComponent {
  String value;
}

0.1.3 #

  • Dart 2 and Angular 5 stable

0.0.10 #

  • Deprecated

    • Adding the script tag is no more necessary
  • Breaking Changes

    • num render() is now returning a Future, Future<num> render()

0.0.9 #

  • Add documentation
  • fix ddc
  • Breaking Changes
    • If you want to use ngModel you have to import formDirectives from angular_forms

0.0.8 #

  • update value when expire

0.0.7 #

  • Upgraded to angular v4.0.0
  • Added Changelog

0.0.1 #

  • Initial version

Use this package as a library

1. Depend on it

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


dependencies:
  angular_recaptcha: ^0.1.3

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter 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_recaptcha/angular_recaptcha.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
45
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
15
Overall:
Weighted score of the above. [more]
55
Learn more about scoring.

We analyzed this package on Feb 25, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5

Health suggestions

Fix lib/angular_recaptcha.dart. (-2.48 points)

Analysis of lib/angular_recaptcha.dart reported 5 hints:

line 58 col 16: Avoid const keyword.

line 62 col 25: Unnecessary new keyword.

line 93 col 3: Avoid return types on setters.

line 120 col 9: Unnecessary new keyword.

line 195 col 23: Prefer to use whereType on iterable.

Maintenance suggestions

Package is getting outdated. (-55.07 points)

The package was last published 80 weeks ago.

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Maintain an example. (-10 points)

Create a short demo in the example/ directory to show how to use this package.

Common filename patterns include main.dart, example.dart, and angular_recaptcha.dart. Packages with multiple examples should provide example/README.md.

For more information see the pub package layout conventions.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0-dev.46.0 <3.0.0
angular ^5.0.0 5.3.1 6.0.0-alpha+1
angular_forms ^2.0.0 2.1.2 2.1.4
dart_browser_loader ^0.0.3 0.0.6+1
js ^0.6.0 0.6.1+1
Transitive dependencies
analyzer 0.35.4 0.39.4
angular_ast 0.5.9 0.5.11
angular_compiler 0.4.3 0.4.5
args 1.5.2
async 2.4.0
build 1.2.2
build_config 0.4.2
built_collection 4.3.2
built_value 7.0.9
charcode 1.1.3
checked_yaml 1.0.2
code_builder 3.2.1
collection 1.14.12
convert 2.1.1
crypto 2.1.4
csslib 0.14.6+1 0.16.1
dart_style 1.2.4 1.3.3
fixnum 0.10.11
front_end 0.1.14 0.1.29
glob 1.2.0
intl 0.15.8 0.16.1
json_annotation 3.0.1
kernel 0.3.14 0.3.29
logging 0.11.4
matcher 0.12.6
meta 1.1.8
node_interop 1.0.3
node_io 1.0.1+2
package_config 1.1.0
path 1.6.4
pedantic 1.9.0
pub_semver 1.4.3
pubspec_parse 0.1.5
quiver 2.1.2+1
source_gen 0.9.4+4 0.9.5
source_span 1.6.0
stack_trace 1.9.3
string_scanner 1.0.5
term_glyph 1.1.0
typed_data 1.1.6
watcher 0.9.7+13
yaml 2.2.0