buildOtpSection static method

Widget buildOtpSection({
  1. required TextEditingController otpController,
  2. void onChanged(
    1. String
    )?,
})

Implementation

static Widget buildOtpSection(
    {required TextEditingController otpController,
    void Function(String)? onChanged}) {
  return Column(
    crossAxisAlignment: CrossAxisAlignment.start,
    children: [
      const CustomText(text: 'Enter The OTP'),
      Padding(
        padding: const EdgeInsets.symmetric(vertical: 12.0),
        child: OTPFieldWidget(
          onCompleted: (value) => otpController.text = value,
          otpController: otpController,
          length: AppConstant.otpLength,
          inputFormatters: [FilteringTextInputFormatter.digitsOnly],
          validator: (p0) {
            return FormValidator.validateOTP(p0);
          },
          onChanged: onChanged,
        ),
      ),
      CustomText.subtitle(
        text: 'To get OTP go to Ypay login then Generate OTP',
      ),
    ],
  );
}