Generate secure passwords, check for exposed passwords, get visual feedback for password strength or get form validation with a minimum password strength required.

Overview

password_strength_checker

License Pub Version Pub Likes Pub Points Pub Popularity GitHub code size in bytes GitHub Repo stars GitHub issues GitHub release (latest by date) GitHub top language CI

Generate secure passwords, check for exposed passwords, get visual feedback for password strength or get form validation with a minimum password strength required.

Check the strength of the password in a visual way, with an animation when the strength changes according to the settings given by the user. Use it also inside a Form to get form validation!

Features

  • Check for exposed common password using the commonDictionary, a map with 10,000 leaked passwords!
  • Use the PasswordStrengthChecker to have a visual feedback.
  • Use the PasswordStrengthFormChecker to have a built-in TextFormField inside the widget and get form validation using a minimumStrengthRequired.
  • Use the PasswordGenerator class to generate a secure random password based on the input configurations (PasswordGeneratorConfiguration).
  • Create your custom strength to create your own rules or use the PasswordStrength default enum (see Custom Strength).

Demo

Demo Form Gif Demo Gif Demo Generator Gif

Getting started

PasswordStrengthChecker

You can use the PasswordStrengthChecker to only have a visual feedback, for example:

final passNotifier = ValueNotifier<PasswordStrength?>(null);
// ...
PasswordStrengthChecker(
  strength: passNotifier,
),

See the full example here.

PasswordStrengthFormChecker

You can use the PasswordStrengthFormChecker to have a built-in TextFormField inside the widget and get form validation using a minimumStrengthRequired. For example:

PasswordStrengthFormChecker(
  minimumStrengthRequired: PasswordStrength.secure,
  onChanged: (password, notifier) {
    notifier.value = PasswordStrength.calculate(text: password);
  },
),

See the full example here.

PasswordGenerator

You can use the PasswordGeneratorclass to generate a secure random password based on the configurations. For example:

final config = PasswordGeneratorConfiguration(
  length: 32,
  minUppercase: 8,
  minSpecialChars: 8,
  // ...
);

final passwordGenerator = PasswordGenerator.fromConfig(
  configuration: config,
);

final password = passwordGenerator.generate();

See the full example here.

Custom Strength

You can use the default PasswordStrength enum to set the strength of the password, or you can create your own enum that implements PasswordStrengthItem and use it. For example:

enum CustomPassStrength implements PasswordStrengthItem {
  weak,
  medium,
  strong;

  @override
  Color get statusColor {
    switch (this) {
      case CustomPassStrength.weak:
        return Colors.red;
      case CustomPassStrength.medium:
        return Colors.orange;
      case CustomPassStrength.strong:
        return Colors.green;
    }
  }

  @override
  Widget? get statusWidget {
    switch (this) {
      case CustomPassStrength.weak:
        return const Text('Weak');
      case CustomPassStrength.medium:
        return const Text('Medium');
      case CustomPassStrength.strong:
        return const Text('Strong');
      default:
        return null;
    }
  }

  @override
  double get widthPerc {
    switch (this) {
      case CustomPassStrength.weak:
        return 0.15;
      case CustomPassStrength.medium:
        return 0.4;
      case CustomPassStrength.strong:
        return 0.75;
      default:
        return 0.0;
    }
  }

  static CustomPassStrength? calculate({required String text}) {
    // Implement your custom logic here
    if (text.isEmpty) {
      return null;
    }
    // Use the [commonDictionary] to see if a password
    // is in 10,000 common exposed password list.
    if (commonDictionary[text] == true) {
      return CustomPassStrength.weak;
    }
    if (text.length < 6) {
      return CustomPassStrength.weak;
    } else if (text.length < 10) {
      return CustomPassStrength.medium;
    } else {
      return CustomPassStrength.strong;
    }
  }
}

Contribution

The project is open source and you can contribute to it here -> repository link

  • If you found a bug, open an issue.
  • If you have a feature request, open an issue.
  • If you want to contribute, submit a pull request.

Contributors


Made with ❤️ from dariowskii

You might also like...

Form builder fix - A package helps in creation of data collection forms in Flutter by removing the boilerplate needed to build a form

Flutter FormBuilder - flutter_form_builder This package helps in creation of dat

Jan 29, 2022

Umbra - visual editor for shaders in Flutter

Umbra Generated by the Very Good CLI 🤖 Umbra, visual editor for shaders in Flutter. Getting Started 🚀 This project contains 3 flavors: development s

Dec 14, 2022

An app for analysing sound waves and building sounds from a visual sound wave graph

An app for analysing sound waves and building sounds from a visual sound wave graph

Wave This app was built for the Science Talent Search Victoria 2022. UPDATE: This project won a minor bursary prize in the Computer Programs category

Dec 20, 2022

Given a JSON string, this library will generate all the necessary Dart classes to parse and generate JSON.

JSON to Dart Given a JSON string, this library will generate all the necessary Dart classes to parse and generate JSON. This library is designed to ge

Dec 25, 2022

A Demo application📱 which stores User feedback from 💙Flutter application into Google Sheets🗎 using Google AppScript.

A Demo application📱  which stores User feedback from 💙Flutter application into Google Sheets🗎 using Google AppScript.

📱 Flutter 💙 to Google Sheets 📊 A Demo application which stores User feedback from Flutter application into Google Sheets using Google AppScript. Yo

Dec 28, 2022

Gaimon - A Flutter plugin to fully support Haptic feedback with custom pattern

Gaimon - A Flutter plugin to fully support Haptic feedback with custom pattern

Gaimon A Flutter plugin to fully support Haptic feedback with custom pattern. 🧐

Dec 9, 2022

A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your issue.

A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your issue.

r_scan A flutter plugin about qr code or bar code scan , it can scan from file、url、memory and camera qr code or bar code .Welcome to feedback your iss

Nov 11, 2022

A flutter plugin for device vibration and haptic feedback.

Vibrate A Flutter plugin to vibrate the device. This uses all the current Haptic Feedback APIs from Apple and provides similar feedback on Android. Ge

Sep 27, 2022

A simple widget for getting better feedback.

A simple widget for getting better feedback.

💰 Using this library in a commercial product? Consider becoming a sponsor. A Flutter package for obtaining better feedback. It allows the user to pro

Dec 31, 2022
Releases(1.2.2)
Owner
Dario Varriale
 iOS Developer && Flutter Developer @ Atobit - Modena, Italy
Dario Varriale
Sample Flutter app for creating basic login forms validation for email and passwords

Email validation Flutter example Sample flutter app showing how to validate a e-mail login form. This example uses the email_validator package for val

Fredrik Eilertsen 22 Dec 15, 2022
Password Strength Meter Flutter GetX

Password Strength Meter Flutter GetX Donate If you found this project helpful or you learned something from the source code and want to thank me, cons

Ripples Code 2 Dec 17, 2021
FlutterBoost is a Flutter plugin which enables hybrid integration of Flutter for your existing native apps with minimum efforts

中文文档 中文介绍 Release Note v3.0-preview.17 PS: Before updating the beta version, please read the CHANGELOG to see if there are any BREAKING CHANGE Flutter

Alibaba 6.3k Dec 30, 2022
Generate passwords using different algorithms. https://kghandour.com/KGPassGen

KG Password Generator Generate passwords using on different algorithms. This project is based on SuperGenPass [ https://chriszarate.github.io/supergen

Karim ElGhandour 3 Nov 8, 2022
An easy configurable and secure open-source personal password manager.

An easy configurable and secure open-source personal password manager. Anyone can you this project and generate his own personal mobile app. All the passwords will be saved into your own Firebase Firestone database with encryption.

Shudipto Trafder 18 Dec 28, 2022
Flutter form fields designed to take much of the burden of form-related coding off the programmer's back — masks, validations, keyboard type, etc.

well_formed Contents Overview Getting Started Demo application References Overview Well-Formed Widget Fields - Well-Formed - is a collection of Flutte

Dartoos 7 Nov 2, 2022
User auth form - Signup and signin user auth form with ability to stay signed in and have an option to signout.

user_auth_form SIgnup and signin user authentification form Getting Started This project is a starting point for a Flutter application. A few resource

null 0 Jan 6, 2022
A Flutter package that provides a dropdown form field using a dropdown button inside a form field.

Dropdown form field A dropdown form field using a dropdown button inside a form field. Demo Features Can be used as regular form field. Simple to impl

Carlos Eugenio Torres 72 Jan 1, 2023
Form builder image picker - Form builder image picker for flutter

form_builder_image_picker Field for picking image(s) from Gallery or Camera for

Ferri Sutanto 0 Jan 28, 2022