'Flutter TextField widget when otp autofill then need to auto submit next page, so what should i do

Flutter TextField widget when otp autofill then need to auto submit next page, so what should i do ->i need to do it without PinCodeTextField.

TextField(

                      autofocus: true,
                      autofillHints: const [AutofillHints.oneTimeCode],
                      keyboardType: TextInputType.phone,
                      controller: textEditingController1,

                      textAlign: TextAlign.center,
                      style: const TextStyle(
                          height: 0.0,
                          color: Colors.black,
                          fontSize: 23

                      ),
                      decoration: InputDecoration(
                          border: OutlineInputBorder(
                            borderSide: const BorderSide(color: Colors.red, width: 2.0),
                            borderRadius: BorderRadius.circular(14.0),
                          ),
                          filled: true,
                          hintStyle: const TextStyle(color: Colors.grey,fontFamily: 'Sans',fontSize: 18.0,height: 0.9),
                          hintText: "OTP",
                          fillColor: Colors.white),
                          maxLength: 6,
                      onSubmitted: (otp) {
                        // this.smsOTP = '123';
                        int length = otp.length;
                        print("onchangeee....");
                        print('$length');
                        if (length == 6){
                          verify(otp);
                          // print("resss $otpsendres");
                        }
                      },
                    ),


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source