From c47c93b2d97d65add71aa35a51d9d2379bb36362 Mon Sep 17 00:00:00 2001 From: Aamir Date: Mon, 18 Dec 2023 16:40:05 +0300 Subject: [PATCH] Android Native Change For Call --- .../live_care/live_care_patient_screen.dart | 191 +++++++++--------- 1 file changed, 92 insertions(+), 99 deletions(-) diff --git a/lib/screens/live_care/live_care_patient_screen.dart b/lib/screens/live_care/live_care_patient_screen.dart index d03378f1..d8a218b9 100644 --- a/lib/screens/live_care/live_care_patient_screen.dart +++ b/lib/screens/live_care/live_care_patient_screen.dart @@ -1,18 +1,17 @@ import 'dart:async'; -import 'dart:convert'; import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/core/service/VideoCallService.dart'; import 'package:doctor_app_flutter/core/viewModel/LiveCarePatientViewModel.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; -import 'package:doctor_app_flutter/locator.dart'; +import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart'; -import 'package:doctor_app_flutter/utils/notification_permission_utils.dart'; +import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_card/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app_text_field_custom_serach.dart'; import 'package:flutter/material.dart'; @@ -91,95 +90,89 @@ class _LiveCarePatientScreenState extends State { model.state == ViewState.Idle ? Expanded( child: Container( - child: - // - // model.filterData.isEmpty - // ? Center( - // child: ErrorMessage( - // error: TranslationBase.of(context).youDontHaveAnyPatient, - // ), - // ) - // : - - ListView.builder( + child: model.filterData.isEmpty + ? Center( + child: ErrorMessage( + error: TranslationBase.of(context).youDontHaveAnyPatient, + ), + ) + : ListView.builder( scrollDirection: Axis.vertical, shrinkWrap: true, - itemCount: 1, // model.filterData.length, + itemCount: model.filterData.length, itemBuilder: (BuildContext ctxt, int index) { // - - String jsonString = ''' - { - "PatientID": 1231755, - "SetupID": "010266", - "PatientType": 1, - "FirstName": "TAMER", - "MiddleName": "MUSA", - "LastName": "FANASHEH", - "FirstNameN": "", - "MiddleNameN": "موسى", - "LastNameN": "", - "Gender": 1, - "DateofBirth": "/Date(558910800000+0300)/", - "DateofBirthN": "25/01/1408", - "NationalityID": "JOR", - "PhoneResi": "", - "PhoneOffice": "", - "MobileNumber": "0537503378", - "FaxNumber": "", - "EmailAddress": "sultan.khan@cloudsolutions.com.sa", - "IsEmailAlertRequired": true, - "IsSMSAlertRequired": true, - "PreferredLanguage": "1", - "EmergencyContactName": "MOH", - "EmergencyContactNo": "0507845867", - "PatientIdentificationType": 2, - "PatientIdentificationNo": "2344670985", - "ProjectID": 15, - "ReceiveHealthSummaryReport": true, - "NoShowCount": 0, - "IsPatientHasMobileDeviceToken": true, - "EditedBy": 102, - "IsIVRStopped": true, - "CRSClientIdentifierID": null, - "CRSVerificationStatus": null, - "CRSVerifiedBy": null, - "CRSVerificationStatusDesc": "Sent for Manual Verification", - "CRSVerificationStatusDescN": "Sent for Manual Verification", - "NumberPosition": 1, - "Status": 2, - "IsPrivilegedMember": null, - "Address": "gffffff al malga", - "Age": 36, - "EmaiLAddress": "sultan.khan@cloudsolutions.com.sa", - "GenderDescription": "Male", - "GenderImage": "https://hmgwebservices.com/Images/GenderAvtar/Male.jpg", - "IsPatientDataVerified": false, - "IsPatientPrivilegedMember": false, - "NationalityDescription": "Jordanian", - "NationalityFlagURL": "https://hmgwebservices.com/Images/flag/JOR.png", - "POBox": "", - "PatientDataVerified": 3, - "PatientName": "TAMER MUSA FANASHEH", - "PatientTypeDescription": "Permanent File", - "PatientTypeDescriptionN": null, - "StatusDscription": "Active ", - "TempAddress": "", - "UpcomingAppointmentsNumber": 0, - "ZipCode": "966" - } - '''; - - Map jsonObject = json.decode(jsonString); - // + // String jsonString = ''' + // { + // "PatientID": 1231755, + // "SetupID": "010266", + // "PatientType": 1, + // "FirstName": "TAMER", + // "MiddleName": "MUSA", + // "LastName": "FANASHEH", + // "FirstNameN": "", + // "MiddleNameN": "موسى", + // "LastNameN": "", + // "Gender": 1, + // "DateofBirth": "/Date(558910800000+0300)/", + // "DateofBirthN": "25/01/1408", + // "NationalityID": "JOR", + // "PhoneResi": "", + // "PhoneOffice": "", + // "MobileNumber": "0537503378", + // "FaxNumber": "", + // "EmailAddress": "sultan.khan@cloudsolutions.com.sa", + // "IsEmailAlertRequired": true, + // "IsSMSAlertRequired": true, + // "PreferredLanguage": "1", + // "EmergencyContactName": "MOH", + // "EmergencyContactNo": "0507845867", + // "PatientIdentificationType": 2, + // "PatientIdentificationNo": "2344670985", + // "ProjectID": 15, + // "ReceiveHealthSummaryReport": true, + // "NoShowCount": 0, + // "IsPatientHasMobileDeviceToken": true, + // "EditedBy": 102, + // "IsIVRStopped": true, + // "CRSClientIdentifierID": null, + // "CRSVerificationStatus": null, + // "CRSVerifiedBy": null, + // "CRSVerificationStatusDesc": "Sent for Manual Verification", + // "CRSVerificationStatusDescN": "Sent for Manual Verification", + // "NumberPosition": 1, + // "Status": 2, + // "IsPrivilegedMember": null, + // "Address": "gffffff al malga", + // "Age": 36, + // "EmaiLAddress": "sultan.khan@cloudsolutions.com.sa", + // "GenderDescription": "Male", + // "GenderImage": "https://hmgwebservices.com/Images/GenderAvtar/Male.jpg", + // "IsPatientDataVerified": false, + // "IsPatientPrivilegedMember": false, + // "NationalityDescription": "Jordanian", + // "NationalityFlagURL": "https://hmgwebservices.com/Images/flag/JOR.png", + // "POBox": "", + // "PatientDataVerified": 3, + // "PatientName": "TAMER MUSA FANASHEH", + // "PatientTypeDescription": "Permanent File", + // "PatientTypeDescriptionN": null, + // "StatusDscription": "Active ", + // "TempAddress": "", + // "UpcomingAppointmentsNumber": 0, + // "ZipCode": "966" + // } + // '''; + // + // Map jsonObject = json.decode(jsonString); + // + // // return Padding( padding: EdgeInsets.all(8.0), child: PatientCard( - patientInfo: PatiantInformtion.fromJson(jsonObject - // model.filterData[index].toJson() - ), + patientInfo: PatiantInformtion.fromJson(model.filterData[index].toJson()), patientType: "0", arrivalType: "0", isFromSearch: false, @@ -187,22 +180,22 @@ class _LiveCarePatientScreenState extends State { isFromLiveCare: true, onTap: () { // TODO change the parameter to daynamic - // Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { - // "patient": PatiantInformtion.fromJson(model.filterData[index].toJson()), - // "patientType": "0", - // "isSearch": false, - // "isInpatient": false, - // "arrivalType": "0", - // "isSearchAndOut": false, - // "isFromLiveCare": true, - // }); + Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { + "patient": PatiantInformtion.fromJson(model.filterData[index].toJson()), + "patientType": "0", + "isSearch": false, + "isInpatient": false, + "arrivalType": "0", + "isSearchAndOut": false, + "isFromLiveCare": true, + }); - AppPermissionsUtils.requestVideoCallPermission( - context: context, - onTapGrant: () { - locator().openVideo(model.startCallRes!, PatiantInformtion.fromJson(jsonObject), - model.startCallRes != null ? model.startCallRes!.isRecording! : true, callConnected, callDisconnected); - }); + // AppPermissionsUtils.requestVideoCallPermission( + // context: context, + // onTapGrant: () { + // locator().openVideo(model.startCallRes!, PatiantInformtion.fromJson(jsonObject), + // model.startCallRes != null ? model.startCallRes!.isRecording! : true, callConnected, callDisconnected); + // }); }, // isFromSearch: widget.isSearch, ),