PackageTrack
Sign in Get early access

pin_code_fields

A highly customizable PIN/OTP input field for Flutter with Material Design support and headless core for custom UIs.

9.4.0 1000K downloads/mo #78 most downloaded on pub.dev adar2378/pin_code_fields

What this package is like to depend on

Last release 3 months ago

20 May 2026

Ships unpredictably

gaps range from 2 weeks to 2.6 years

Some releases are documented

notes for 14 of 55 stable releases

1 version withdrawn

withdrawn after publishing

7 years old

59 releases · first in 2019

6 releases in the last 12 months

see the full history below

Release timeline

59 releases · Jul 2019 to May 2026
2020 2021 2022 2023 2024 2025 2026
Release Pre-release Withdrawn

Releases

latest 59
  1. 9.4.0 20 May 2026
    Release notes
    • FIX: suppress semantic hint and focused state when disabled (#427).
    • FIX: reorder inputFormatters so user formatters run before length limit.
    • FIX: reorder inputFormatters so user formatters run before length limit.
    • FEAT: add semanticHintBuilder for customizable accessibility hints.
    • FEAT: add custom input formatters demo.
    • FEAT: add mainAxisSize property for flexible sizing.
    • FEAT: add custom input formatters demo.

    2026-02-22

    Changes


    Packages with breaking changes:

    • There are no breaking changes in this release.

    Packages with other changes:


    Open source →
    Release notes
    • FIX: suppress semantic hint and focused state when disabled (#427).
    • FIX: reorder inputFormatters so user formatters run before length limit.
    • FIX: reorder inputFormatters so user formatters run before length limit.
    • FEAT: add semanticHintBuilder for customizable accessibility hints.
    • FEAT: add custom input formatters demo.
    • FEAT: add mainAxisSize property for flexible sizing.
    • FEAT: add custom input formatters demo.
    Open source →
  2. 9.3.0 29 Mar 2026
    Release notes
    • FEAT: add semanticHintBuilder parameter for customizable accessibility hints.
      • Enables localization of screen reader hints to different languages
      • Supports custom terminology (e.g., "characters" instead of "digits")
      • Allows static hints for context-specific guidance
      • Maintains backward compatibility with default English hints
      • Fixes #424
    Open source →
  3. 9.1.0 22 Feb 2026
    Release notes

    Features ✨

    • Theme Extension: Added MaterialPinThemeExtension for embedding MaterialPinTheme in ThemeData
      • Register a default PIN theme at the app level using ThemeData.extensions
      • Access the theme anywhere with Theme.of(context).materialPinTheme
      • Supports light/dark theme configurations
      • MaterialPinField automatically uses the global theme when no explicit theme is provided
      • Added example demo showing app-wide theming usage
    • MaterialPinFormField: New Material Design form field with built-in Form validation
      • Combines MaterialPinField styling with FormField capabilities (validator, onSaved, autovalidateMode)
      • Dual error states: controller errors trigger shake animation, form validation shows error text below the field
      • Theme resolution from widget prop, ThemeData extension, or default
      • reset() clears both text and controller error state

    Bug Fixes 🐛

    • PinInputFormField: Added missing parameters that exist in PinInputonClipboardFound, clipboardValidator, onLongPress, onTapOutside, mouseCursor, semanticLabel

    Documentation 📚

    • Updated README with "App-Wide Theming" section
    • Added code examples for theme extension setup and usage

    Open source →
  4. 9.0.0 16 Feb 2026
    Release notes

    Breaking Changes ⚠️

    This is a complete rewrite with a new headless architecture. Migration required.

    • New Headless Architecture: The package now provides both a headless core (PinInput) and a Material Design implementation (MaterialPinField)
    • Unified Controller: PinInputController replaces separate TextEditingController, FocusNode, and errorAnimationController
    • Theme System: New MaterialPinTheme with automatic ColorScheme resolution
    • Renamed Parameters: See migration guide below

    Features ✨

    • Headless Core: Build completely custom PIN UIs with PinInput and PinCellData
    • Material Design Ready: Use MaterialPinField for beautiful, ready-to-use PIN fields
    • PinInputController: Single controller for text, focus, and error state management
      • setText(), clear(), text - Text control
      • triggerError(), clearError(), hasError - Error control
      • requestFocus(), unfocus(), hasFocus - Focus control
    • Improved Animations: Scale, fade, slide, and none animation types
    • All Cell Shapes: Outlined, filled, underlined, and circle
    • Text Gradient: Apply gradients to PIN text via MaterialPinTheme.textGradient
    • Custom Obscuring Widget: Use any widget for obscuring with obscuringWidget
    • Form Integration: PinInputFormField for form validation
    • SMS Autofill: Full autofill support with enableAutofill and autofillHints
    • Haptic Feedback: Configurable haptic feedback types
    • Accessibility (Semantics): Full screen reader support with semanticLabel parameter
      • Announces field purpose (e.g., "6-digit PIN code field")
      • Provides hints about remaining digits
      • Masks values when obscured for privacy
      • Exposes enabled/focused states
    • cursorAlignment: Position custom cursor widgets within cells (e.g., underscore at bottom)
    • onClipboardFound: Callback when clipboard contains valid PIN-like content on focus
    • onTapOutside: Callback when user taps outside the field
    • errorText & errorBuilder: Custom error display below the PIN field
    • followingFillColor & followingBorderColor: Style for cells after the focused cell
    • completeFillColor, completeBorderColor & completeTextStyle: Style when all cells are filled

    Bug Fixes 🐛

    • iOS App Hang fix: All Clipboard.getData calls are now guarded with a 500 ms timeout so a stalled native clipboard never blocks the UI thread
    • Focus-triggered clipboard probe deferred: _checkClipboard() dispatched via addPostFrameCallback instead of running synchronously inside the focus listener
    • Long-press paste deferred: Default context menu no longer triggers an eager clipboard read; clipboard data is read only after the user explicitly taps Paste
    • Centralised safe clipboard helper: All clipboard reads go through _safeClipboardRead() with try/catch + .timeout()
    • Focus on complete: Last cell now shows focused state when PIN is complete and field is focused
    • Cursor alignment: Fixed custom cursor positioning - removed internal Center widget that was overriding alignment
    • Web input: Fixed text input not working on web by adjusting invisible text field configuration
    • Controller notifications: Fixed PinInputController not notifying listeners on focus/text changes

    Example App 📱

    • Added comprehensive use case demos (OTP verification, PIN setup, PIN login, payment confirmation, invite codes, app lock screen)
    • Added feature demos for all customization options
    • Added interactive Playground for real-time customization of all options

    Documentation 📚

    • Updated README with demo GIFs showcasing all features
    • Added static screenshots for pub.dev gallery

    Migration Guide

    Parameter Renames

    Old Name New Name
    controller pinController.textController
    focusNode pinController.focusNode
    useHapticFeedback enableHapticFeedback
    hapticFeedbackTypes hapticFeedbackType
    animationType theme.entryAnimation
    enableContextMenu enablePaste
    errorAnimationController pinController.triggerError()
    pinTheme theme (MaterialPinTheme)
    enablePinAutofill enableAutofill

    Basic Migration

    Before (v8.x):

    PinCodeTextField(
      appContext: context,
      length: 6,
      controller: textController,
      focusNode: focusNode,
      pinTheme: PinTheme(
        shape: PinCodeFieldShape.box,
        activeColor: Colors.blue,
      ),
      onChanged: (value) {},
      onCompleted: (value) {},
    )
    

    After (v9.0):

    final pinController = PinInputController();
    
    MaterialPinField(
      length: 6,
      pinController: pinController,
      theme: MaterialPinTheme(
        shape: MaterialPinShape.outlined,
        focusedBorderColor: Colors.blue,
      ),
      onChanged: (value) {},
      onCompleted: (value) {},
    )
    

    Error Handling Migration

    Before:

    final errorController = StreamController<ErrorAnimationType>();
    errorController.add(ErrorAnimationType.shake);
    

    After:

    final pinController = PinInputController();
    pinController.triggerError();  // Triggers shake + sets error state
    pinController.clearError();    // Clears error state
    

    Open source →
  5. 9.0.0-dev.3 02 Feb 2026 pre-release

    Nothing published for this version

  6. 9.0.0-dev.2 02 Feb 2026 pre-release

    Nothing published for this version

  7. 8.0.1 24 Jun 2023

    Nothing published for this version

  8. 8.0.0 24 Jun 2023

    Nothing published for this version

  9. 7.5.0 24 Jun 2023 withdrawn

    Nothing published for this version

  10. 7.4.0 03 Apr 2022

    Nothing published for this version

  11. 7.3.0 21 Jul 2021
    Release notes

    AutovalidateMode.disabled will not add extra space below the pin cells
    Added new attributes errorBorderColor, readOnly, textGradient and scrollPadding

    Open source →
  12. 7.2.0 26 May 2021
    Release notes
    • Much requested feature placeholder has been added hintCharacter
    • hintStyle has been added to customize the hint TextStyle
    Open source →
  13. 7.1.0 07 May 2021

    Nothing published for this version

  14. 7.0.0 11 Mar 2021
    Release notes

    Features ✨

    • Added AutofillContextAction, default is AutofillContextAction.commit

    Breaking changes ⚠️

    • Migrated to null-safety.
    • Minimum Flutter version is set to 1.22.0

    Fixes 🐛

    • Fixed default text value not showing, #153
    Open source →
  15. 7.0.0-nullsafety 05 Mar 2021 pre-release

    Nothing published for this version

  16. 6.1.0 20 Jan 2021
    Release notes

    Features ✨

    • Added haptic feedback enum HapticFeedbackTypes { heavy, light, medium, selection, vibrate, }
    • Added animated obscure widget support obscuringWidget and blinkWhenObscuring

    Fixes 🐛

    • Fixed bug related to TextStyle not given.
    • Fixed bug related to setState is being called after disposal.
    Open source →
  17. 6.0.2 29 Dec 2020
    Release notes

    Added fallback color when the cursor color fails to retrive and fixed deprecated List constructors.

    Open source →
  18. 6.0.1 10 Nov 2020
    Release notes

    Fixed read-only warning when field is not enabled & cursor animation now only triggers if showCursor = true

    Open source →
  19. 6.0.0 10 Oct 2020
    Release notes

    Features ✨

    • Added Cursor
      `
      /// Whether to show cursor or not
      final bool showCursor;

      /// The color of the cursor, default to Theme.of(context).accentColor
      final Color cursorColor;

      /// width of the cursor, default to 2
      final double cursorWidth;

      /// Height of the cursor, default to FontSize + 8;
      final double cursorHeight;
      `

    • Added boxhShadows

    Breaking changes ⚠️

    • autoValidate changed according to the new version of Flutter
    • Minimum Flutter version is set to 1.22.0

    Fixes 🐛

    • typo fixes
    Open source →
  20. 5.2.0 03 Oct 2020

    Nothing published for this version

  21. 5.1.0 16 Sep 2020
    Release notes

    [5.1.0]

    Features ✨

    • Added errorAnimationDuration to customize Error animation duration.
    • Added enablePinAutofill to enable or disable the auto-fill feature.

    Breaking changes ⚠️

    • Chagned textInputType to more familiar keyboardType to change they keyboard type

    Fixes 🐛

    • Fixed rootNavigator issue for paste dialogs, #101
    Open source →
  22. 5.0.1 18 Aug 2020

    Nothing published for this version

  23. 5.0.0 15 Aug 2020
    Release notes

    Features ✨

    • Added onSave, onTap callbacks.
    • Added PastedTextStyle.
    • Added iOS autofill added wtih Flutter version 1.20.0

    Breaking changes ⚠️

    • Must provide context in the appContext parameter.
    • Minimum Flutter version is set to 1.20.0

    Fixes 🐛

    Open source →
  24. 4.0.0 15 Jul 2020
    Release notes

    Features ✨
    Added support for flutter-web
    Breaking changes ⚠️
    Replaced internal automatic OS selection for dialog styles, you can select which style you want by configuring with the DialogConfig

    Open source →
  25. 3.1.2 14 Jun 2020

    Nothing published for this version

  26. 3.1.1 14 Jun 2020

    Nothing published for this version

  27. 3.1.0 14 Jun 2020

    Nothing published for this version

  28. 3.0.1 18 May 2020

    Nothing published for this version

  29. 3.0.0 03 May 2020

    Nothing published for this version

  30. 2.5.1 11 Apr 2020

    Nothing published for this version

  31. 2.5.0 11 Apr 2020

    Nothing published for this version

  32. 2.4.0 10 Mar 2020

    Nothing published for this version

  33. 2.3.0 29 Nov 2019

    Nothing published for this version

  34. 2.3.0+1 29 Nov 2019

    Nothing published for this version

  35. 2.3.0+2 11 Dec 2019

    Nothing published for this version

  36. 2.3.0+3 17 Dec 2019

    Nothing published for this version

  37. 2.2.1 24 Nov 2019

    Nothing published for this version

  38. 2.2.1+1 27 Nov 2019

    Nothing published for this version

  39. 2.2.1+2 27 Nov 2019

    Nothing published for this version

  40. 2.2.0 22 Nov 2019

    Nothing published for this version

  41. 2.2.0+1 22 Nov 2019

    Nothing published for this version

  42. 2.2.0+2 23 Nov 2019

    Nothing published for this version

  43. 2.2.0+3 23 Nov 2019

    Nothing published for this version

  44. 2.2.0+4 23 Nov 2019

    Nothing published for this version

  45. 2.1.1 17 Nov 2019

    Nothing published for this version

  46. 2.1.0 17 Nov 2019

    Nothing published for this version

  47. 2.0.4 03 Nov 2019

    Nothing published for this version

  48. 2.0.3 01 Nov 2019

    Nothing published for this version

  49. 2.0.2 13 Oct 2019

    Nothing published for this version

  50. 2.0.1 12 Oct 2019

    Nothing published for this version

  51. 2.0.0 12 Oct 2019

    Nothing published for this version

  52. 1.1.2 29 Jul 2019

    Nothing published for this version

  53. 1.1.1 29 Jul 2019

    Nothing published for this version

  54. 1.1.0 29 Jul 2019

    Nothing published for this version

  55. 1.0.4 27 Jul 2019

    Nothing published for this version

  56. 1.0.3 27 Jul 2019

    Nothing published for this version

  57. 1.0.2 27 Jul 2019

    Nothing published for this version

  58. 1.0.1 27 Jul 2019

    Nothing published for this version

  59. 1.0.0 27 Jul 2019

    Nothing published for this version

Every package, every release, already written down.

The archive is open and free. Watching your own project is what we are building next.

Browse the archive