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

flutter_pin_code_fields のカバー
パッケージ詳細v2.2.0

flutter_pin_code_fields

カスタマイズ可能なピンコードフィールドを生成するのに役立つFlutterパッケージです。ログインPINやOTPに使用できます。

AndroidiOSWebmacOSWindowsLinux
30日間ダウンロード
2490
いいね数
28
Pub ポイント
150

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

flutter pub add flutter_pin_code_fields

パッケージ概要

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

ログイン用PINやOTP入力に最適な、カスタマイズ可能なFlutterパッケージです。さまざまなスタイルオプションと入力検証をサポートするクリーンで再利用可能なインターフェースを提供します。Android、iOS、Web、macOS、Windows、Linuxなど、すべての主要プラットフォームで互換性があります。シンプルさと柔軟性を意識して設計されており、開発者がアプリ内に安全で使いやすいPIN入力体験を簡単に統合できるようにしています。

用途

  • OTP検証フロー
  • PINでユーザーログイン
  • セキュアな認証インターフェース
  • 数値コードを必要とするフォーム入力
  • 複数ステップのオンボーディングプロセス

主な機能

  • カスタマイズ可能なフィールドの外観
  • さまざまな入力タイプのサポート
  • 組み込み検証
  • クロスプラットフォーム互換性
  • フォームコントローラーとの簡単な統合
  • すべてのデバイス向けのレスポンシブデザイン

適している対象

  • 認証機能を開発している開発者
  • セキュアなPIN入力が必要なアプリ
  • OTP入力フィールドが必要なプロジェクト
  • 数値入力を含むUI重視のフォーム
  • 一貫したUXを備えたモバイルおよびウェブアプリケーション

注意事項

  • 提出ロジックの手動処理が必要です
  • 制限された組み込みエラーフィードバック
  • バイオメトリックフォールバックのネイティブサポートなし
  • 複雑なテーマ用に追加のスタイリングが必要になる場合があります
  • 6〜8桁を超える非常に長いPINには最適化されていません

元の README

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

Flutter Pin Code Fields

GitHub workflow status Version GitHub license

A Flutter package to generate customizable pin code fields.

⭐️ to show support!

Features

  • Highly customizable
  • Responsive
  • Supports animations
  • Supports autofocus
  • Supports autofill
  • Supports obscuring text with custom character

Usage

Add flutter_pin_code_fields as a dependency in your pubspec.yaml file.

# pubspec.yaml

dependencies:
  flutter_pin_code_fields: <latest_version>
import import 'package:flutter_pin_code_fields/flutter_pin_code_fields.dart';

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return PinCodeFields(
      onComplete(text) => print(text);
    );
  }
}

Examples

Basic

Complete example at example/lib/basic.dart.

Example - Basic
PinCodeFields(
  onComplete(text) => print(text),
)

Obscuring text

Complete example at example/lib/obscuring_text.dart.

Example - Obscuring text
PinCodeFields(
  length: 6,
  obscureText: true,
  obscureCharacter: "🔴",
  onComplete(text) => print(text),
)

Customized

Complete example at example/lib/customized.dart.

Example - Customized
PinCodeFields(
  length: 4,
  fieldBorderStyle: FieldBorderStyle.square,
  responsive: false,
  fieldHeight: 130.0,
  fieldWidth: 130.0,
  borderWidth: 5.0,
  activeBorderColor: Colors.blue,
  activeBackgroundColor: Colors.white,
  borderRadius: BorderRadius.circular(20.0),
  keyboardType: TextInputType.number,
  inputFormatters: [FilteringTextInputFormatter.digitsOnly],
  autoHideKeyboard: false,
  fieldBackgroundColor: Colors.black12,
  borderColor: Colors.black12,
  textStyle: TextStyle(
    fontSize: 30.0,
    fontWeight: FontWeight.bold,
  ),
  onComplete(text) => print(text),
)

Animated

Complete example at example/lib/animated.dart.

Example - Animated
PinCodeFields(
  obscureText: true,
  obscureCharacter: "❌",
  animation: Animations.rotateRight,
  animationDuration: Duration(milliseconds: 250),
  animationCurve: Curves.bounceInOut,
  switchInAnimationCurve: Curves.bounceIn,
  switchOutAnimationCurve: Curves.bounceOut,
)

Properties

Name Type Default Description
length int 4 Total number of pin code fields.
margin EdgeInsets EdgeInsets.all(5.0) Margin between the fields.
padding EdgeInsets EdgeInsets.only(bottom: 5.0) Padding within the field.
fieldHeight double Height of the field.
fieldWidth double Width of the field.
borderWidth double 2.0 Width of the border of the field.
borderRadius BorderRadius Border raduis of the field.
borderColor Color Colors.grey Border color of the field.
activeBorderColor Color Colors.blue Border color of the active field.
fieldBorderStyle FieldBorderStyle FieldBorderStyle.bottom Border styles of the field.
fieldBackgroundColor Color Colors.transparent Background color of the fields.
activeBackgroundColor Color Colors.transparent Background color of the active field.
enabled bool true Enable/ disable editing the fields.
responsive bool true Adjust the size of the fields automatically to the available space.
autofocus bool false Enable/ disabled autofocus.
textStyle TextStyle Text style for the fields.
obscureText bool false Enable/ disable obscuring the text in the fields.
obscureCharacter String * Character to obscure the text in the fields.
keyboardType TextInputType TextInputType.visiblePassword Keyboard type.
inputFormatters List<TextInputFormatter> Input formatters for the fields.
autoHideKeyboard bool true Hides the keyboard automatically on complete.
animation Animations Animations.fade Animation for the fields.
animationDuration Duration Duration(milliseconds: 150) Duration of the animation.
animationCurve Curve Curves.easeInOut Animation curve.
switchInAnimationCurve Curve Curves.easeIn Switch in animation curve.
switchOutAnimationCurve Curve Curves.easeOut Switch out animation curve.
controller TextEditingController Text editing controller for the fields.
focusNode FocusNode Focus node for the fields.
onChange ValueChanged<String> Callback that returns text on input.
onComplete [required] ValueChanged<String> Callback that returns text on filling all the fields.

カテゴリー

ソースリポジトリ

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