otpTextField function
Widget
otpTextField({
- int length = 4,
- bool autoFocus = false,
- TextEditingController? controller,
- MainAxisAlignment mainAxisAlignment = MainAxisAlignment.spaceBetween,
- String? hintCharacter,
- void onCompleted()?,
- double borderRadius = 8,
- PinCodeFieldShape shape = PinCodeFieldShape.box,
- EdgeInsetsGeometry? fieldOuterPadding,
- double fieldHeight = 64,
- double fieldWidth = 60,
- Color? fillColor,
- Color? borderColor,
Implementation
Widget otpTextField({
final int length = 4,
final bool autoFocus = false,
final TextEditingController? controller,
final MainAxisAlignment mainAxisAlignment = MainAxisAlignment.spaceBetween,
final String? hintCharacter,
final void Function(String)? onCompleted,
final double borderRadius = 8,
final PinCodeFieldShape shape = PinCodeFieldShape.box,
final EdgeInsetsGeometry? fieldOuterPadding,
final double fieldHeight = 64,
final double fieldWidth = 60,
final Color? fillColor,
final Color? borderColor,
}) =>
PinCodeTextField(
controller: controller,
appContext: context,
length: length,
autoFocus: autoFocus,
mainAxisAlignment: mainAxisAlignment,
hintCharacter: hintCharacter,
animationType: AnimationType.fade,
pinTheme: PinTheme(
shape: shape,
fieldOuterPadding: fieldOuterPadding,
borderRadius: BorderRadius.circular(borderRadius),
fieldHeight: fieldHeight,
fieldWidth: fieldWidth,
activeFillColor: fillColor,
inactiveFillColor: fillColor,
selectedFillColor: fillColor,
inactiveColor: borderColor,
selectedColor: borderColor,
activeColor: borderColor,
),
enableActiveFill: true,
keyboardType: TextInputType.number,
onCompleted: onCompleted,
onChanged: (final _) {},
).ltr();