isValidPIN method

bool isValidPIN([
  1. int length = 4
])

Implementation

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