Giter Site home page Giter Site logo

flutter-password-strength's Introduction

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

Arguments Default Type Description
password required String Password
width null double Strength bar width
height 5 double Strength bar height
strengthColors null TweenSequence 0.0 ~ 0.25 : red, 0.26 ~ 0.5 : yellow, 0.51 ~ 0.75 : blue, 0.76 ~ 1 : green
backgroundColor Colors.grey Color background for strength bar
radius 0 double Strength bar radius
duration milliseconds: 300 Duration Animation duration
strengthCallback null void Function(double strength) Strength callback, return between 0 to 1

flutter-password-strength's People

Contributors

iamriajul avatar jinhoso avatar renovate-bot avatar schillingdavid avatar zoliabraham avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

flutter-password-strength's Issues

Only number passwords accepted as best passwords

When user types passwords containing only numbers charsetBonus becomes 1.8, which is higher.

Need to add another control for numbers

if (RegExp(r'^[0-9]*$').hasMatch(password)) {
    charsetBonus = 0.5;
}

add how to use strengthColors to docs.

Hello. I'm trying to change the strengthColors colors. I am unable to do so. Would you be able to add and example to the readme? Thank you.

TweenSequence<Color>([ TweenSequenceItem( weight: 1.0, tween: ColorTween( begin: Theme.of(context).errorColor, end: Theme.of(context).warning, ), ), TweenSequenceItem( weight: 1.0, tween: ColorTween( begin: Theme.of(context).warning, end: Colors.blue, ), ), TweenSequenceItem( weight: 1.0, tween: ColorTween( begin: Colors.blue, end: Theme.of(context) .colorScheme .primary, ), ), ]),
Screen Shot 2021-04-03 at 8 44 26 AM

_FlutterPasswordStrengthState#61795(ticker active) was disposed with an active Ticker.

Steps to produce the error

When FlutterPasswordStrength widgets get hidden, this stack trace shows in logs.
image

Logs

`════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown while finalizing the widget tree:
_FlutterPasswordStrengthState#61795(ticker active) was disposed with an active Ticker.

_FlutterPasswordStrengthState created a Ticker via its SingleTickerProviderStateMixin, but at the time dispose() was called on the mixin, that Ticker was still active. The Ticker must be disposed before calling super.dispose().

Tickers used by AnimationControllers should be disposed by calling dispose() on the AnimationController itself. Otherwise, the ticker will leak.

The offending ticker was: Ticker(created by _FlutterPasswordStrengthState#61795(lifecycle state: created))
The stack trace when the Ticker was actually created was:
#0 new Ticker. (package:flutter/src/scheduler/ticker.dart:66:40)
#1 new Ticker (package:flutter/src/scheduler/ticker.dart:68:6)
#2 SingleTickerProviderStateMixin.createTicker (package:flutter/src/widgets/ticker_provider.dart:129:15)
#3 new AnimationController (package:flutter/src/animation/animation_controller.dart:247:21)
#4 _FlutterPasswordStrengthState.initState (package:flutter_password_strength/flutter_password_strength.dart:133:9)
#5 StatefulElement._firstBuild (package:flutter/src/widgets/framework.dart:4640:58)
#6 ComponentElement.mount (package:flutter/src/widgets/framework.dart:4476:5)
... Normal element mounting (10 frames)
#16 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
#17 MultiChildRenderObjectElement.mount (package:flutter/src/widgets/framework.dart:5947:32)
... Normal element mounting (4 frames)
#21 Element.inflateWidget (package:flutter/src/widgets/framework.dart:3446:14)
#22 Element.updateChild (package:flutter/src/widgets/framework.dart:3211:20)
#23 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4527:16)
#24 Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
#25 StatelessElement.update (package:flutter/src/widgets/framework.dart:4583:5)
#26 Element.updateChild (package:flutter/src/widgets/framework.dart:3201:15)
#27 ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:4527:16)
#28 StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:4675:11)
#29 Element.rebuild (package:flutter/src/widgets/framework.dart:4218:5)
#30 BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2627:33)
#31 WidgetsBinding.drawFrame (package:flutter/src/widgets/binding.dart:883:20)
#32 RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:284:5)
#33 SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1113:15)
#34 SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1052:9)
#35 SchedulerBinding._handleDrawFrame (package:flutter/src/scheduler/binding.dart:968:5)
#39 _invoke (dart:ui/hooks.dart:261:10)
#40 _drawFrame (dart:ui/hooks.dart:219:3)
(elided 3 frames from dart:async)

When the exception was thrown, this was the stack:
#0 SingleTickerProviderStateMixin.dispose. (package:flutter/src/widgets/ticker_provider.dart:142:7)
#1 SingleTickerProviderStateMixin.dispose (package:flutter/src/widgets/ticker_provider.dart:156:6)
#2 _FlutterPasswordStrengthState.dispose (package:flutter_password_strength/flutter_password_strength.dart:172:11)
#3 StatefulElement.unmount (package:flutter/src/widgets/framework.dart:4729:12)
#4 _InactiveElements._unmount (package:flutter/src/widgets/framework.dart:1922:13)
...
════════════════════════════════════════════════════════════════════════════════════════════════════`

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • Update sakebook/actions-flutter-pub-publisher action to v1.4.1
  • Update actions/checkout action to v4
  • Update kotlin monorepo to v2 (major) (org.jetbrains.kotlin:kotlin-stdlib-jdk7, org.jetbrains.kotlin:kotlin-gradle-plugin)
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/main.yml
  • actions/checkout v1
  • sakebook/actions-flutter-pub-publisher v1.2.0
gradle
example/android/gradle.properties
example/android/settings.gradle
example/android/build.gradle
  • com.android.tools.build:gradle 3.5.0
  • org.jetbrains.kotlin:kotlin-gradle-plugin 1.3.50
  • org.jetbrains.kotlin:kotlin-stdlib-jdk7 1.3.50
example/android/app/build.gradle
  • junit:junit 4.12
  • androidx.test:runner 1.1.1
  • androidx.test.espresso:espresso-core 3.1.1
gradle-wrapper
example/android/gradle/wrapper/gradle-wrapper.properties
  • gradle 6.0.1
pub
example/pubspec.yaml
  • flutter
  • cupertino_icons ^0.1.2
  • dart >=2.12.0 <3.0.0
pubspec.yaml
  • flutter
  • dart >=2.12.0 <3.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.