isValid static method
Implementation
static bool isValid(String card, [stripBeforeValidation = true]) {
if (stripBeforeValidation) {
card = strip(card);
}
if (card.isEmpty) {
return false;
}
if (card.length < minLength || card.length > maxLength) {
return false;
}
if (!RegExp(r'^\d+$').hasMatch(card)) {
return false;
}
if (RegExp(r'^(\d)\1+$').hasMatch(card)) {
return false;
}
return _luhnCheck(card);
}