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,
- double borderWidth = 1,
- Color? fillColor,
- Color? cursorColor,
- 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 double borderWidth = 1,
final Color? fillColor,
final Color? cursorColor,
final Color? borderColor,
}) =>
PinCodeTextField(
controller: controller,
appContext: context,
length: length,
autoFocus: autoFocus,
cursorColor: cursorColor,
mainAxisAlignment: mainAxisAlignment,
hintCharacter: hintCharacter,
animationType: AnimationType.fade,
pinTheme: PinTheme(
shape: shape,
fieldOuterPadding: fieldOuterPadding,
borderRadius: BorderRadius.circular(borderRadius),
fieldHeight: fieldHeight,
fieldWidth: fieldWidth,
borderWidth: borderWidth ,
activeFillColor: fillColor,
inactiveFillColor: fillColor,
selectedFillColor: fillColor,
inactiveColor: borderColor,
selectedColor: borderColor,
activeColor: borderColor,
),
enableActiveFill: true,
keyboardType: TextInputType.number,
onCompleted: onCompleted,
onChanged: (final _) {},
).ltr();