FacematchResponse.fromJson constructor Null safety

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

Implementation

factory FacematchResponse.fromJson(Map<String, dynamic> json) {

  if(json[MapConstants.result] != null){
    return FacematchResponse(
      base64Selfie: "",
      base64Document: "",
      status: json[MapConstants.result],
    );
  }else{
    var statusIOS = false;
    if(json['Status'] == 1){
      statusIOS = true;
    }
    return FacematchResponse(
      base64Selfie: json['Base64Selfie'],
      base64Document: json['Base64Document'],
      status: statusIOS,
    );
  }
}