otpTextField function

Widget otpTextField({
  1. int length = 4,
  2. bool autoFocus = false,
  3. TextEditingController? controller,
  4. MainAxisAlignment mainAxisAlignment = MainAxisAlignment.spaceBetween,
  5. String? hintCharacter,
  6. void onCompleted(
    1. String
    )?,
  7. double borderRadius = 8,
  8. PinCodeFieldShape shape = PinCodeFieldShape.box,
  9. EdgeInsetsGeometry? fieldOuterPadding,
  10. double fieldHeight = 64,
  11. double fieldWidth = 60,
  12. Color? fillColor,
  13. 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();