isValidOTP method

bool isValidOTP(
  1. int otpLength
)

Implementation

bool isValidOTP(int otpLength) {
  if (isEmpty) return false;
  // print(otpLength);
  final regExp = RegExp(
    r'^[0-9]{' + otpLength.toString() + r',' + otpLength.toString() + r'}$',
  );
  return regExp.hasMatch(this);
}