Note: This package was just updated on OTPTextField because the author does not accept pull requests.

OTP Text Field V2

A flutter package to create a OTP Text Field widget in your application.



Pub

📱Screenshots


⚙️ Installation

Import the following package in your dart file

import 'package:otp_text_field/otp_text_field_v2.dart';

OR

import 'package:otp_text_field/otp_field_v2.dart';

👨‍💻 Usage

Use the OTP Text Field V2 Widget

OTPTextFieldV2(
            controller: otpController,
            length: 5,
            width: MediaQuery.of(context).size.width,
            textFieldAlignment: MainAxisAlignment.spaceAround,
            fieldWidth: 45,
            fieldStyle: FieldStyle.box,
            outlineBorderRadius: 15,
            style: TextStyle(fontSize: 17),
            onChanged: (pin) {
              print("Changed: " + pin);
            },
            onCompleted: (pin) {
              print("Completed: " + pin);
            },
),

For more detail on usage, check out the example provided.

🙍🏻‍♂️ Edited BY