搜尋分類、套件與程式碼儲存庫

pin_code_fields 封面
套件詳情v10.1.1

pin_code_fields

一個高度可自訂的 PIN/OTP 輸入欄位,支援 Material Design,並具備用於自訂 UI 的無頭核心。

AndroidiOSWebmacOSWindowsLinux
近 30 天下載
41.5萬
喜歡數
2390
Pub 分數
160

安裝套件

flutter pub add pin_code_fields

套件介紹

根據套件公開資料產生的選型評估,僅供參考。

一個高度可自訂的 Flutter PIN 與 OTP 輸入欄位,依照 Material Design 原則設計。支援視覺化與無頭模式,讓開發者能建構直覺的驗證介面或完全自訂的 UI。此套件提供流暢動畫、即時驗證,並在所有平台實現響應式設計。非常適合登入畫面、驗證流程與安全輸入表單。

適用情境

  • 透過OTP進行使用者驗證
  • 雙因素驗證
  • 安全PIN輸入
  • 行動應用程式中的表單驗證
  • 可自訂的驗證螢幕
  • 跨平台輸入欄位

主要特色

  • 符合 Material Design
  • 無頭模式用於自定義UI
  • 即時輸入驗證
  • 流暢的動畫和過渡
  • 響應式佈局支援
  • 可自定義的樣式和行為

適合對象

  • 開發安全輸入表單的開發者
  • 需要跨平台相容性的團隊
  • 需要 OTP 或 PIN 驗證的應用
  • 希望擁有靈活 UI 組件的設計師
  • 需要緊密整合的專案

使用建議

  • 在無頭模式下需要手動處理焦點和導航
  • 可能需要額外的邏輯來處理複雜的驗證規則
  • 樣式自定義需要理解 Flutter 的 widget 樹
  • 未針對非常長的輸入序列進行優化
  • 內建錯誤訊息有限,僅提供基本回饋

原始 README

以下為關聯原始碼儲存庫的 README 原文快照,最新內容請造訪原始碼儲存庫。

Pin Code Fields

A highly customizable Flutter package for PIN code and OTP input fields with beautiful design and animations.

Version 9.0 introduces a new headless architecture - use the ready-made Material Design implementation or build completely custom UIs!

Package Location

The publishable package is located at:

packages/pin_code_fields/

📦 View Package README for full documentation.

Quick Start

dependencies:
  pin_code_fields: ^9.0.0
import 'package:pin_code_fields/pin_code_fields.dart';

// Material Design (ready to use)
MaterialPinField(
  length: 6,
  onCompleted: (pin) => print('PIN: $pin'),
)

// Custom UI (headless)
PinInput(
  length: 4,
  builder: (context, cells) => YourCustomUI(cells),
)

Repository Structure

pin_code_fields/
├── packages/
│   └── pin_code_fields/      # 📦 Main package
│       ├── lib/
│       │   └── src/
│       │       ├── core/     # Headless input engine
│       │       └── material/ # Material Design implementation
│       ├── example/
│       ├── test/
│       ├── README.md
│       ├── CHANGELOG.md
│       └── LICENSE
├── docs/
│   └── FEATURE_COMPARISON.md
├── melos.yaml
└── CLAUDE.md

Development

This project uses melos for monorepo management.

# Install melos
dart pub global activate melos

# Bootstrap workspace
melos bootstrap

# Run tests
melos test

# Run analyzer
melos analyze

Features

  • 🎨 Headless Architecture - Full control over UI rendering
  • 📱 Material Design Ready - Beautiful out-of-the-box implementation
  • 🎮 Unified Controller - Single controller for text, focus, and errors
  • ✨ Rich Animations - Scale, fade, slide entry animations
  • 🔐 Obscure Support - Character or custom widget obscuring
  • 📋 Paste Support - Long-press to paste from clipboard
  • 📝 Form Integration - Works with Flutter's Form widget
  • 📲 Autofill Support - SMS OTP autofill for iOS/Android
  • 💫 Error Animation - Shake animation with programmatic control

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

MIT License - see LICENSE for details.

所屬分類

依賴

依賴清單 2 項

原始碼儲存庫

使用此套件的專案

所在榜單