Note: This package was just updated on OTPTextField because the author does not accept pull requests.
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';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.
