toString method

  1. @override
String toString()
override

Returns the phone number with country code concatenated.

This method ensures the country code has a '+' prefix and concatenates it with the phone number.

Example: "+5511987654321"

Implementation

@override
String toString() {
  final normalizedCountryCode =
      countryCode.startsWith('+') ? countryCode : '+$countryCode';

  return '$normalizedCountryCode$phone';
}