flutter_password_strength 0.1.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 87

flutter_password_strength #

A password strength checker for flutter.

Features #

  • Linear strength indicator.
  • Customise colors, borders, etc.

Screenshot #

Usage #

    import 'package:flutter_password_strength/flutter_password_strength.dart';

    FlutterPasswordStrength(
      password: _password, 
      strengthCallback: (strength){
        debugPrint(strength.toString());
      }
    )

Arguments #

ArgumentsDefaultTypeDescription
passwordrequiredStringPassword
widthnulldoubleStrength bar width
height5doubleStrength bar height
strengthColorsnullTweenSequence0.0 ~ 0.25 : red, 0.26 ~ 0.5 : yellow, 0.51 ~ 0.75 : blue, 0.76 ~ 1 : green
backgroundColorColors.greyColorbackground for strength bar
radius0doubleStrength bar radius
duration3000DurationAnimation duration
strengthCallbacknullvoid Function(double strength)Strength callback, return between 0 to 1

[0.1.4] - changed license to MIT. #

[0.1.3] - applied flutter format. #

[0.1.2] - added example. #

[0.0.1] - initial release. #

example/lib/main.dart

import 'package:flutter/material.dart';
import './component/sign_in_form.dart';

void main() => runApp(MyApp());

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Password Strength Demo',
      theme: ThemeData(
        primarySwatch: Colors.blue,
      ),
      home: MyHomePage(title: 'Password Strength Demo'),
    );
  }
}

class MyHomePage extends StatefulWidget {
  MyHomePage({Key key, this.title}) : super(key: key);

  final String title;

  @override
  _MyHomePageState createState() => _MyHomePageState();
}

class _MyHomePageState extends State<MyHomePage> {
  String _password;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text(widget.title),
      ),
      body: Center(
        child: SignInForm()
      ),
    );
  }
}

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_password_strength: ^0.1.4

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support 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:flutter_password_strength/flutter_password_strength.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
75
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
100
Overall:
Weighted score of the above. [more]
87
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.11 1.14.12
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test