Skip to content
pubscout

pin_input_text_field

4.5.3, released 2 months ago by tinocheng.app

A customisable TextField widget to display and input PIN codes in Flutter.

WASM-readyRock solid
$ flutter pub add pin_input_text_field
Source repository

What it does

PinInputTextField provides a specialized text field widget designed for PIN codes and OTP inputs. It supports customized shapes, multiple built-in styles such as underlines and boxes, obscuring text, and form validation integration.

AI-written summary of version 4.5.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to build a PIN or OTP verification screen.
  • You require specific styling like underlined or boxed character segments.

Skip it when

  • You need a standard single-line text input field.
  • You are using a Flutter version below 3.7.0 (requires 4.4.1 or lower for older versions).

Strengths

  • Pure Dart with no extra dependencies.
  • Supports multiple built-in pin styles like UnderlineDecoration, BoxLooseDecoration, BoxTightDecoration, and CircleDecoration.
  • Supports all platforms supported by Flutter.

Weaknesses

  • The PinEditingController listener may execute more than once when programmatically setting text.
  • Some onSubmit callbacks might not work consistently on Android.

Setup

Kind
Flutter widgets
Effort
Low
Code generation
No
Direct dependencies
0
PinInputTextField(
  pinLength: 6,
  decoration: BoxLooseDecoration(
    strokeColorBuilder: const FixedColorBuilder(Colors.black),
  ),
  controller: TextEditingController(),
  onChanged: (pin) {
    debugPrint(pin);
  },
)

Alternatives

Packages that do the same job and could replace pin_input_text_field.

  • pinput

    Alternative customizable PIN input widget with rich features and extensive styling options.

  • pin_code_fields

    Another popular alternative for OTP and PIN input fields with support for animations and error animations.

Works with

Packages commonly used together with pin_input_text_field: ones it builds on, ones built on it, and its own family.