isValidOTP method

bool isValidOTP([
  1. int length = 6
])

Implementation

bool isValidOTP([int length = 6]) {
  return this.length == length && RegExp(r'^\d+$').hasMatch(this);
}