otp property

List<ValidationRule> otp
final

Validation rules for OTP (One-Time Password) fields.

Requires:

  • The OTP to be non-empty.
  • Exactly 6 characters in length.

Implementation

static final List<ValidationRule> otp = [
  Validators.required(message: 'OTP is required'),
  Validators.minLength(6, message: 'OTP must be at least 6 characters long'),
  Validators.maxLength(6, message: 'OTP must not exceed 6 characters'),
];