title: How can i add validation to otp filed when otp field is empty in flutter
body: <p>here I get some problems. how I can I add validation to the plaintext field or any field which is used for OTP enter. if someone has another field for OTP entering please let me know. hope you understand. please help me.</p>
  
  <p><a href="https://i.stack.imgur.com/AfBdx.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/AfBdx.jpg" alt="enter image description here"></a></p>
  
  <pre><code>  _onAlertotp(context) {
      Alert(
          context: context,
          title: "OTP expires in: MM:SS (Counter",
          desc:
              "We have Texted and/or Emailed OTP (One Time Pin) to your registered cell phone and/ or email account. Please check and enter OTP below to activate your TUDO account",
          content: Column(
            children: &lt;Widget&gt;[
              Form(
                autovalidate: true,
                child: PinField(
                    padding: EdgeInsets.all(16.0),
                    length: 6,
                    gap: 6.0,
                    onSubmitted: Validators().otpValidate,
                    keyboardType: TextInputType.numberWithOptions(signed: true),
                    inputFormatters: [WhitelistingTextInputFormatter.digitsOnly]),
              )
            ],
          ),
          buttons: [
            DialogButton(
              onPressed: () =&gt; Navigator.pop(context),
              child: Text(
                "Resend OTP",
                style: TextStyle(color: Colors.white, fontSize: 20),
              ),
            ),
            DialogButton(
              onPressed: () {
                _onAlertrunningbusiness(context);
              },
              child: Text(
                "Enter Otp",
                style: TextStyle(color: Colors.white, fontSize: 20),
              ),
            )
          ]).show();
    }
  </code></pre>