getSharedData method

String getSharedData(
  1. HCP? hcp,
  2. List<String?>? rxCodes,
  3. List<String?>? dxCodes
)

Implementation

String getSharedData(HCP? hcp, List<String?>? rxCodes,  List<String?>? dxCodes){
  Map<String, dynamic> data = {};
  // if(hcp != null){
    try{
      PlatformData platformData = PlatformData();
      if(hcp != null) {
        data[platformData.id] = hcp.hcpId;
        data[platformData.nm] = "${hcp.firstName!} ${hcp.lastName!}";
        data[platformData.em] = hcp.email;
        data[platformData.sp] = hcp.specialization!;
        data[platformData.hc] = "";
        data[platformData.mob] = hcp.mobile;
        data[platformData.dob] = hcp.dob;
        data[platformData.gen] = hcp.gender;
        data[platformData.wl] = hcp.city;
        data[platformData.pn] = "Partner ID";
      }

      if(rxCodes != null && rxCodes.isNotEmpty){
        data[platformData.rx] = rxCodes;
      }
      if(dxCodes != null && dxCodes.isNotEmpty){
        data[platformData.dx] = dxCodes;
      }

    }catch(err){
      Log(tag).e(err.toString());
    }
  // }
  return data.toString();
}