pin_otp_field 0.0.1 copy "pin_otp_field: ^0.0.1" to clipboard
pin_otp_field: ^0.0.1 copied to clipboard

A customizable Flutter widget for entering PIN or OTP codes, supporting various styles and input behaviors.

pin_otp_field #

A customizable Flutter widget for entering PIN or OTP codes, supporting various styles and input behaviors.

Features #

  • Customizable length and style
  • Supports numeric and alphanumeric input
  • Handles paste and autofill
  • Error and success states

Installation #

Add to your pubspec.yaml:

dependencies:
  pin_otp_field: ^0.0.1

Then run:

flutter pub get

Usage #

Import the package:

import 'package:pin_otp_field/pin_otp_field.dart';

Use the widget in your app:

PinOtpField(
  length: 6,
  onChanged: (value) {
    print('Current value: $value');
  },
  onCompleted: (value) {
    print('Completed with: $value');
  },
  // Customize appearance and behavior as needed
)

Example #

class OtpScreen extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: PinOtpField(
          length: 4,
          onCompleted: (code) {
            // Handle completed code
          },
        ),
      ),
    );
  }
}

License #

See LICENSE.

1
likes
0
points
21
downloads

Publisher

unverified uploader

Weekly Downloads

A customizable Flutter widget for entering PIN or OTP codes, supporting various styles and input behaviors.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

flutter

More

Packages that depend on pin_otp_field