FLUTTER ECOSYSTEM

ArefMozafari/flutter_pw_validator

Flutter 비밀번호 검증 패키지는 Flutter 앱에서 사용자가 입력한 비밀번호를 검증하는 데 도움을 줍니다.

flutter_pw_validator 프로젝트 이미지
Stars
33
Forks
46
최근 푸시(UTC)
2023. 10. 23.
프로젝트 상태
활성
Aref Mozafari  GitHub avatar
GITHUB User

Aref Mozafari ↗

Flutter/Mobile Engineer at CoDeTech.cc

Core Decentralized TechnologiesIran
언어DartSwiftKotlinObjective-C

기술 주제

이 저장소가 배포한 패키지

사용 중인 의존성

의존성 목록 2 개
  • flutter{"sdk":"flutter"}
  • flutter_test개발 의존성{"sdk":"flutter"}

원본 README

아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.

README 펼치기 / 접기

Flutter Password Validator

License Pub Version GitHub stars

https://user-images.githubusercontent.com/29792606/108348045-89a33480-71f6-11eb-99a9-bf56a09f0e26.gif https://user-images.githubusercontent.com/29792606/108348177-afc8d480-71f6-11eb-991c-34fad5bcf621.gif https://user-images.githubusercontent.com/29792606/108348154-a9d2f380-71f6-11eb-9c80-20400eba992e.gif https://user-images.githubusercontent.com/29792606/108406989-626d5700-7238-11eb-87bd-8e8b1adeb680.gif


Flutter Password Validator package helps you to validate sign-in user-entered passwords with your rules.

How to use

1- Depend on it
Add it to your package's pubspec.yaml file:
dependencies:
  flutter_pw_validator: <latest>
2- Install it
Install packages from the command line:
flutter pub get
3- Usage
First You have to import the file:
import 'package:flutter_pw_validator/flutter_pw_validator.dart';
And then just put it right under your password TextField and pass the controller to that:
new TextField(
    controller: _passwordController
),
new FlutterPwValidator(
    controller: _passwordController,
    minLength: 6,
    uppercaseCharCount: 2,
    lowercaseCharCount: 2,
    numericCharCount: 3,
    specialCharCount: 1,
    width: 400,
    height: 150,
    onSuccess: yourCallbackFunction,
    onFail: yourCallbackFunction
)
Properties
Property Description Default Value Required
controller Takes your password TextField controller null Yes
minLength Takes total minimum length of password null Yes
uppercaseCharCount Takes minimum uppercase character count that has to include in the password 0 No
lowercaseCharCount Takes minimum lowercase character count that has to include in the password 0 No
numericCharCount Takes minimum numeric character count that has to include in the password 0 No
specialCharCount Takes minimum special character count that has to include in the password 0 No
width Takes the widget width null Yes
height Takes the widget height null Yes
onSuccess A void callback function that runs when the password is matched with the condition(s) null Yes
onFail A void callback that gets called everytime the password doesn't match with the condition(s) null No
defaultColor Takes default state color of the widget Color(0xFFd3d3d3) No
successColor Takes success state color of the widget Color(0xFF2ee292) No
failureColor Takes failure state color of the widget Color(0xFFf9433e) No
strings A class implementing the default FlutterPwValidatorStrings English FlutterPwValidatorStrings No
key Key to access the widget state and its functions GlobalKey<FlutterPwValidatorState>() null No

i18n

If you want to translate this plugin simply implements the FlutterPwValidatorStrings class and pass it to the widget.

class FrenchStrings implements FlutterPwValidatorStrings {
  @override
  final String atLeast = 'Au moins - caractères';
  @override
  final String uppercaseLetters = '- Lettres majuscules';
  @override
  final String numericCharacters = '- Chiffres';
  @override
  final String specialCharacters = '- Caractères spéciaux';
}

FlutterPwValidator(
    // ...
    // your config above
    strings: FrenchStrings()
)

Example Project

You can use this example project to see how it works.