operator + method Null safety

PhoneNumber operator +(
  1. int operand
)

numerically add operand to this phone number e.g.

PhoneParser.parseRaw('61383208100') + 1 == PhoneParser.parseRaw('61383208101');

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'),
  );
}