fromJson static method

PhoneNumberInfo? fromJson(
  1. Map<String, dynamic>? json
)

Implementation

static PhoneNumberInfo? fromJson(Map<String, dynamic>? json) {
  if (json == null) {
    return null;
  }

  return PhoneNumberInfo(
    country: CountryInfo.fromJson(tdMapFromJson(json['country'])),
    countryCallingCode: (json['country_calling_code'] as String?) ?? '',
    formattedPhoneNumber: (json['formatted_phone_number'] as String?) ?? '',
    isAnonymous: (json['is_anonymous'] as bool?) ?? false,
  );
}