checkPanDigit property

int? get checkPanDigit

Retrieves the check digit from the PAN.

The check digit is the last digit of the PAN, which is used for validation purposes.
If the PAN is empty, null or invalid, it returns null.

Returns:

  • The check digit as an integer, or null if the PAN is empty or null.

Implementation

int? get checkPanDigit {
  if (pan.isNotEmpty) {
    final isValid = isPanValid();
    if (!isValid) {
      return null;
    } else {
      return pan.calculateCheckDigit();
    }
  }
  return null;
}