operator - method

PhoneNumber operator -(
  1. int operand
)

numerically subtract operand from this phone number e.g.

PhoneParser.parseRaw('61383208100') - 1 == PhoneParser.parseRaw('61383208099');

Implementation

PhoneNumber operator -(int operand) {
  final nsnLength = nsn.length;
  final resultNsn = BigInt.parse(nsn) - BigInt.from(operand);
  return PhoneNumber(
    isoCode: isoCode,
    nsn: resultNsn.toString().padLeft(nsnLength, '0'),
  );
}