GrxPhoneNumber.fromJson constructor

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

Creates a GrxPhoneNumber from a JSON map.

Expected JSON format:

{
  "phone": "11987654321",
  "countryCode": "+55"
}

Implementation

factory GrxPhoneNumber.fromJson(Map<String, dynamic> json) {
  return GrxPhoneNumber(
    phone: json['phone'] as String? ?? '',
    countryCode: json['countryCode'] as String? ?? '',
  );
}