パッケージ、リポジトリ、アプリカテゴリを検索

flutter_pw_validator のカバー
パッケージ詳細v2.0.0

flutter_pw_validator

Flutter Pw Validatorパッケージは、ユーザーがログイン時に入力したパスワードを、ご自身のルールに従って検証するのに役立ちます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2780
いいね数
176
Pub ポイント
160

パッケージをインストール

flutter pub add flutter_pw_validator

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutter Pw Validator は、カスタマイズ可能なルールに従ってユーザーが入力したパスワードを検証するための軽量パッケージです。最小文字数、特殊文字の含む、または数字の要件など、特定の基準への準拠を保証し、パスワードの強度を確保します。認証フローに最適で、複数プラットフォームのログインフォームにシームレスに統合できます。Android、iOS、Web、macOS、Windows、Linux をサポートしており、クロスプラットフォームアプリケーションに非常に柔軟に対応可能です。シンプルなAPIにより、開発者は複雑な検証ロジックを書かずに安全なパスワードポリシーを簡単に適用できます。

用途

  • ユーザー登録フォーム
  • パスワード強度チェック
  • セキュアなログインワークフロー
  • 認証フォーム検証
  • セキュリティポリシーの遵守

主な機能

  • カスタマイズ可能な検証ルール
  • クロスプラットフォーム対応
  • シンプルな統合
  • リアルタイムフィードバック
  • 軽量で高速

適している対象

  • セキュアな認証システムを構築する開発者
  • 強力なパスワードポリシーを必要とするアプリ
  • クロスプラットフォームのFlutterアプリケーション
  • モバイルおよびウェブアプリケーションでのフォーム検証
  • ユーザーのセキュリティを最優先するチーム

注意事項

  • 手動でのルール設定が必要です
  • 組み込みのUIコンポーネントなし
  • 開発者が定義した基準に依存します
  • パスワード検証のみに制限
  • 複雑な資格情報管理には適していません

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Flutter Password Validator

License Pub Version GitHub stars


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.

カテゴリー

依存関係

依存関係一覧 1 件

  • password_rules^1.0.0

ソースリポジトリ

このパッケージを使用しているプロジェクト