otp_input 1.0.3 copy "otp_input: ^1.0.3" to clipboard
otp_input: ^1.0.3 copied to clipboard

Otp Input

OtpInputField #

A Flutter package that provides a customizable OTP (One-Time Password) input field.

Installation #

To use this package, add otp_input as a dependency in your pubspec.yaml file:

dependencies:
  otp_input: ^1.0.3

Then run #

flutter pub get

Usage #

Import the package in your Dart file:

import 'package:otp_input/otp_input.dart';

Add the OtpInputField widget to your widget tree:

OtpInputField(
  otpInputFieldCount: 4,
  width: 0.2,
  onOtpEntered: (otp) {
    print('Entered OTP: $otp');
    // Perform actions with the entered OTP
  },
)

Properties #

  • otpInputFieldCount: The number of OTP input fields.
  • width: The width factor of each input field, a value between 0.0 and 1.0.
  • onOtpEntered: Callback function triggered when all OTP fields are filled.

Issues and Contributions #

Feel free to open issues or contribute to this package on GitHub.

2
likes
130
points
48
downloads

Publisher

unverified uploader

Weekly Downloads

Otp Input

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on otp_input