Null Safety Fixes

update_flutter_3.16.0_voipcall
Aamir Muhammad 2 years ago
parent 941134da49
commit 3b2ee0ef65

@ -24,7 +24,6 @@ class LabResultHistory {
String? verifiedOn; String? verifiedOn;
String? verifiedOnDateTime; String? verifiedOnDateTime;
LabResultHistory( LabResultHistory(
{this.description, {this.description,
this.femaleInterpretativeData, this.femaleInterpretativeData,
@ -79,7 +78,7 @@ class LabResultHistory {
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = Map<String, dynamic>();
data['Description'] = this.description; data['Description'] = this.description;
data['FemaleInterpretativeData'] = this.femaleInterpretativeData; data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
data['Gender'] = this.gender; data['Gender'] = this.gender;

@ -1,3 +1,5 @@
import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart'; import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_model.dart';
import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_request.dart'; import 'package:doctor_app_flutter/core/model/labs/all_special_lab_result_request.dart';
@ -183,6 +185,7 @@ class LabsService extends BaseService {
await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, onSuccess: (dynamic response, int statusCode) { await baseAppClient.postPatient(GET_PATIENT_LAB_ORDERS_RESULT_HISTORY_BY_DESCRIPTION, patient: patient, onSuccess: (dynamic response, int statusCode) {
labOrdersResultHistoryList.clear(); labOrdersResultHistoryList.clear();
response['ListGeneralResultHistory'].forEach((lab) { response['ListGeneralResultHistory'].forEach((lab) {
print(jsonEncode(lab));
labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab)); labOrdersResultHistoryList.add(LabResultHistory.fromJson(lab));
}); });
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {

@ -3,26 +3,24 @@ import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart'; import 'package:doctor_app_flutter/core/model/live_care/AlternativeServicesList.dart';
import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart'; import 'package:doctor_app_flutter/core/model/live_care/PendingPatientERForDoctorAppRequestModel.dart';
import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart'; import 'package:doctor_app_flutter/core/model/live_care/live_care_login_reguest_model.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart'; import 'package:doctor_app_flutter/core/model/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/core/model/livecare/start_call_req.dart'; import 'package:doctor_app_flutter/core/model/livecare/start_call_req.dart';
import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart'; import 'package:doctor_app_flutter/core/model/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/service/home/dasboard_service.dart';
import 'package:doctor_app_flutter/core/service/patient/LiveCarePatientServices.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import '../../locator.dart'; import '../../locator.dart';
class LiveCarePatientViewModel extends BaseViewModel { class LiveCarePatientViewModel extends BaseViewModel {
List<PatiantInformtion> filterData = []; List<PatiantInformtion> filterData = [];
LiveCarePatientServices _liveCarePatientServices = LiveCarePatientServices _liveCarePatientServices = locator<LiveCarePatientServices>();
locator<LiveCarePatientServices>();
StartCallRes get startCallRes => _liveCarePatientServices.startCallRes; StartCallRes? get startCallRes => _liveCarePatientServices.startCallRes;
List<AlternativeService> get alternativeServicesList => List<AlternativeService> get alternativeServicesList => _liveCarePatientServices.alternativeServicesList;
_liveCarePatientServices.alternativeServicesList;
DashboardService _dashboardService = locator<DashboardService>(); DashboardService _dashboardService = locator<DashboardService>();
@ -33,12 +31,8 @@ class LiveCarePatientViewModel extends BaseViewModel {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} }
PendingPatientERForDoctorAppRequestModel PendingPatientERForDoctorAppRequestModel pendingPatientERForDoctorAppRequestModel = PendingPatientERForDoctorAppRequestModel(sErServiceID: _dashboardService.sServiceID, outSA: false);
pendingPatientERForDoctorAppRequestModel = await _liveCarePatientServices.getPendingPatientERForDoctorApp(pendingPatientERForDoctorAppRequestModel);
PendingPatientERForDoctorAppRequestModel(
sErServiceID: _dashboardService.sServiceID, outSA: false);
await _liveCarePatientServices.getPendingPatientERForDoctorApp(
pendingPatientERForDoctorAppRequestModel);
if (_liveCarePatientServices.hasError) { if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error; error = _liveCarePatientServices.error;
@ -170,16 +164,11 @@ class LiveCarePatientViewModel extends BaseViewModel {
if (strExist) { if (strExist) {
filterData = []; filterData = [];
for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) { for (var i = 0; i < _liveCarePatientServices.patientList.length; i++) {
String fullName = String fullName = _liveCarePatientServices.patientList[i].fullName!.toUpperCase();
_liveCarePatientServices.patientList[i].fullName!.toUpperCase(); String patientID = _liveCarePatientServices.patientList[i].patientId.toString();
String patientID = String mobile = _liveCarePatientServices.patientList[i].mobileNumber!.toUpperCase();
_liveCarePatientServices.patientList[i].patientId.toString();
String mobile = if (fullName.contains(str.toUpperCase()) || patientID.contains(str) || mobile.contains(str)) {
_liveCarePatientServices.patientList[i].mobileNumber!.toUpperCase();
if (fullName.contains(str.toUpperCase()) ||
patientID.contains(str) ||
mobile.contains(str)) {
filterData.add(_liveCarePatientServices.patientList[i]); filterData.add(_liveCarePatientServices.patientList[i]);
} }
} }
@ -193,16 +182,13 @@ class LiveCarePatientViewModel extends BaseViewModel {
Future isLogin(int loginStatus) async { Future isLogin(int loginStatus) async {
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
LiveCareUserLoginRequestModel userLoginRequestModel = LiveCareUserLoginRequestModel userLoginRequestModel = new LiveCareUserLoginRequestModel();
new LiveCareUserLoginRequestModel(); userLoginRequestModel.isOutKsa = (doctorProfile!.projectID == 2 || doctorProfile!.projectID == 3) ? 1 : 0;
userLoginRequestModel.isOutKsa =
(doctorProfile!.projectID == 2 || doctorProfile!.projectID == 3) ? 1 : 0;
userLoginRequestModel.isLogin = loginStatus; userLoginRequestModel.isLogin = loginStatus;
userLoginRequestModel.generalid = "Cs2020@2016\$2958"; userLoginRequestModel.generalid = "Cs2020@2016\$2958";
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _liveCarePatientServices.isLogin( await _liveCarePatientServices.isLogin(loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel);
loginStatus: loginStatus, isLoginRequestModel: userLoginRequestModel);
if (_liveCarePatientServices.hasError) { if (_liveCarePatientServices.hasError) {
error = _liveCarePatientServices.error; error = _liveCarePatientServices.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -220,8 +206,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
AlternativeService(serviceID: 2, serviceName: "LABORATORY"), AlternativeService(serviceID: 2, serviceName: "LABORATORY"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService( AlternativeService(serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"),
serviceID: 3, serviceName: "RADIOLOGY(ULTRASOUND) For pregnant only"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"), AlternativeService(serviceID: 4, serviceName: "VACCINATIONS"),
@ -242,8 +227,7 @@ class LiveCarePatientViewModel extends BaseViewModel {
AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"), AlternativeService(serviceID: 9, serviceName: "FAMILY MEDICIN DR"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService( AlternativeService(serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"),
serviceID: 10, serviceName: "FOLYS CATHETER INSERTION"),
); );
alternativeServicesList.add( alternativeServicesList.add(
AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"), AlternativeService(serviceID: 11, serviceName: "GASTRIC TUBE CHANGE"),

@ -95,7 +95,7 @@ class SOAPViewModel extends BaseViewModel {
get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel; get medicationFrequencyList => _SOAPService.medicationFrequencyListWithModel;
List<GetMedicationResponseModel> get allMedicationList => _prescriptionService.allMedicationList; List<GetMedicationResponseModel>? get allMedicationList => _prescriptionService.allMedicationList;
late SubjectiveCallBack subjectiveCallBack; late SubjectiveCallBack subjectiveCallBack;
@ -249,8 +249,8 @@ class SOAPViewModel extends BaseViewModel {
String getAllergicNames(isArabic) { String getAllergicNames(isArabic) {
String allergiesString = ''; String allergiesString = '';
patientAllergiesList.forEach((element) { patientAllergiesList.forEach((element) {
MasterKeyModel selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType!)!; MasterKeyModel? selectedAllergy = getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType!);
if (selectedAllergy != null && element.isChecked!) allergiesString += ((isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , ')!; if (selectedAllergy != null && element.isChecked!) allergiesString += ((isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn)! + ' , ');
}); });
return allergiesString; return allergiesString;
} }
@ -447,7 +447,7 @@ class SOAPViewModel extends BaseViewModel {
episodeId: patientInfo.episodeNo, episodeId: patientInfo.episodeNo,
episodeID: patientInfo.episodeNo, episodeID: patientInfo.episodeNo,
doctorID: ''); doctorID: '');
var services = [_SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)]; var services = [await _SOAPService.getPatientChiefComplaint(getChiefComplaintReqModel)];
if (patientInfo.admissionNo == null) { if (patientInfo.admissionNo == null) {
complaintsControllerError = ''; complaintsControllerError = '';
@ -455,62 +455,62 @@ class SOAPViewModel extends BaseViewModel {
illnessControllerError = ''; illnessControllerError = '';
GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel(
patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: ''); patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
services.add(_SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true)); services.add(await _SOAPService.getPatientHistories(getHistoryReqModel, isFirst: true));
GeneralGetReqForSOAP generalGetReqForSOAP = GeneralGetReqForSOAP generalGetReqForSOAP =
GeneralGetReqForSOAP(patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: ''); GeneralGetReqForSOAP(patientMRN: patientInfo.patientMRN, episodeId: patientInfo.episodeNo, appointmentNo: int.parse(patientInfo.appointmentNo.toString()), doctorID: '', editedBy: '');
services.add(_SOAPService.getPatientAllergy(generalGetReqForSOAP)); services.add(await _SOAPService.getPatientAllergy(generalGetReqForSOAP));
} }
final results = await Future.wait(services); final results = services;
await callServicesAfterGetPatientInfoForUpdateSubject(); await callServicesAfterGetPatientInfoForUpdateSubject();
} }
callServicesAfterGetPatientInfoForUpdateSubject() async { callServicesAfterGetPatientInfoForUpdateSubject() async {
var services; List services = [];
if (patientHistoryList.isNotEmpty) { if (patientHistoryList.isNotEmpty) {
if (historyFamilyList.isEmpty) { if (historyFamilyList.isEmpty) {
if (services == null) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)];
} else { } else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryFamily)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistoryFamily));
} }
} }
if (historyMedicalList.isEmpty) { if (historyMedicalList.isEmpty) {
if (services == null) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)];
} else } else
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistoryMedical)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistoryMedical));
} }
if (historySurgicalList.length == 0) { if (historySurgicalList.length == 0) {
if (services == null) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)];
} else } else
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySurgical)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistorySurgical));
} }
if (historySportList.length == 0) { if (historySportList.length == 0) {
if (services == null) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.HistorySports)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.HistorySports)];
} else } else
services.add(_SOAPService.getMasterLookup(MasterKeysService.HistorySports)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.HistorySports));
} }
} }
if (patientAllergiesList.isNotEmpty) { if (patientAllergiesList.isNotEmpty) {
if (allergiesList.isEmpty) if (services == null) { if (allergiesList.isEmpty) if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.Allergies)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.Allergies)];
} else } else
services.add(_SOAPService.getMasterLookup(MasterKeysService.Allergies)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.Allergies));
if (allergySeverityList.isEmpty) { if (allergySeverityList.isEmpty) {
if (services == null) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)];
} else } else
services.add(_SOAPService.getMasterLookup(MasterKeysService.AllergySeverity)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.AllergySeverity));
} }
} }
final results = await Future.wait(services ?? []); final results = services;
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
@ -524,37 +524,37 @@ class SOAPViewModel extends BaseViewModel {
List services = []; List services = [];
if (medicationStrengthList.length == 0) { if (medicationStrengthList.length == 0) {
if (services.isEmpty) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)];
} else { } else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationStrength)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationStrength));
} }
} }
if (medicationFrequencyList.length == 0) { if (medicationFrequencyList.length == 0) {
if (services.isEmpty) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)];
} else { } else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationFrequency));
} }
} }
if (medicationDoseTimeList.length == 0) { if (medicationDoseTimeList.length == 0) {
if (services.isEmpty) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)];
} else { } else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationDoseTime));
} }
} }
if (medicationRouteList.length == 0) { if (medicationRouteList.length == 0) {
if (services.isEmpty) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)];
} else { } else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.MedicationRoute)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.MedicationRoute));
} }
} }
if (allMedicationList.length == 0) { if (allMedicationList!.isEmpty) {
if (services.isEmpty) { if (services.isEmpty) {
services = [_prescriptionService.getMedicationList()]; services = [await _prescriptionService.getMedicationList()];
} else { } else {
services.add(_prescriptionService.getMedicationList()); services.add(await _prescriptionService.getMedicationList());
} }
} }
@ -568,30 +568,30 @@ class SOAPViewModel extends BaseViewModel {
callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async { callAddAssessmentLookupsServices({String searchKey = "", bool allowSetState = true}) async {
if (allowSetState) setState(ViewState.Busy); if (allowSetState) setState(ViewState.Busy);
var services; List services = [];
if (listOfDiagnosisCondition.length == 0) { if (listOfDiagnosisCondition.isEmpty) {
if (services == null) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)];
} else { } else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisCondition));
} }
} }
if (listOfDiagnosisType.length == 0) { if (listOfDiagnosisType.length == 0) {
if (services == null) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)];
} else { } else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.DiagnosisType)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.DiagnosisType));
} }
} }
if (listOfICD10.length == 0) { if (listOfICD10.length == 0) {
if (services == null) { if (services.isEmpty) {
services = [_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)]; services = [await _SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)];
} else { } else {
services.add(_SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey)); services.add(await _SOAPService.getMasterLookup(MasterKeysService.ICD10, searchKey: searchKey));
} }
} }
final results = await Future.wait(services ?? []); final results = services;
if (allowSetState) { if (allowSetState) {
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
@ -605,9 +605,9 @@ class SOAPViewModel extends BaseViewModel {
GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel( GetAssessmentReqModel getAssessmentReqModel = GetAssessmentReqModel(
patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: int.parse(patientInfo.appointmentNo.toString())); patientMRN: patientInfo.patientMRN, episodeID: patientInfo.episodeNo.toString(), editedBy: '', doctorID: '', appointmentNo: int.parse(patientInfo.appointmentNo.toString()));
var services = [_SOAPService.getPatientAssessment(getAssessmentReqModel)]; var services = [await _SOAPService.getPatientAssessment(getAssessmentReqModel)];
final results = await Future.wait(services); final results = services;
if (patientAssessmentList.isNotEmpty) { if (patientAssessmentList.isNotEmpty) {
await callAddAssessmentLookupsServices(allowSetState: false); await callAddAssessmentLookupsServices(allowSetState: false);
@ -621,38 +621,38 @@ class SOAPViewModel extends BaseViewModel {
} }
postSubjectServices({patientInfo, String? complaintsText, String? medicationText, String? illnessText, List<MySelectedHistory>? myHistoryList, List<MySelectedAllergy>? myAllergiesList}) async { postSubjectServices({patientInfo, String? complaintsText, String? medicationText, String? illnessText, List<MySelectedHistory>? myHistoryList, List<MySelectedAllergy>? myAllergiesList}) async {
var services; List services = [];
PostChiefComplaintRequestModel postChiefComplaintRequestModel = PostChiefComplaintRequestModel postChiefComplaintRequestModel =
createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText!, medicationText: medicationText!, complaintsText: complaintsText!); createPostChiefComplaintRequestModel(patientInfo: patientInfo, illnessText: illnessText!, medicationText: medicationText!, complaintsText: complaintsText!);
if (patientChiefComplaintList.isEmpty) { if (patientChiefComplaintList.isEmpty) {
postChiefComplaintRequestModel.editedBy = ''; postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.postChiefComplaint(postChiefComplaintRequestModel)]; services = [await _SOAPService.postChiefComplaint(postChiefComplaintRequestModel)];
} else { } else {
postChiefComplaintRequestModel.editedBy = ''; postChiefComplaintRequestModel.editedBy = '';
services = [_SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)]; services = [await _SOAPService.patchChiefComplaint(postChiefComplaintRequestModel)];
} }
if (myHistoryList!.length != 0) { if (myHistoryList!.length != 0) {
PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList); PostHistoriesRequestModel postHistoriesRequestModel = createPostHistoriesRequestModel(patientInfo: patientInfo, myHistoryList: myHistoryList);
if (patientHistoryList.isEmpty) { if (patientHistoryList.isEmpty) {
services.add(_SOAPService.postHistories(postHistoriesRequestModel)); services.add(await _SOAPService.postHistories(postHistoriesRequestModel));
} else { } else {
services.add(_SOAPService.patchHistories(postHistoriesRequestModel)); services.add(await _SOAPService.patchHistories(postHistoriesRequestModel));
} }
} }
if (myAllergiesList!.length != 0) { if (myAllergiesList!.length != 0) {
PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo); PostAllergyRequestModel postAllergyRequestModel = createPostAllergyRequestModel(myAllergiesList: myAllergiesList, patientInfo: patientInfo);
if (patientAllergiesList.isEmpty) { if (patientAllergiesList.isEmpty) {
services.add(_SOAPService.postAllergy(postAllergyRequestModel)); services.add(await _SOAPService.postAllergy(postAllergyRequestModel));
} else { } else {
services.add(_SOAPService.patchAllergy(postAllergyRequestModel)); services.add(await _SOAPService.patchAllergy(postAllergyRequestModel));
} }
} }
final results = await Future.wait(services); final results = services;
if (_SOAPService.hasError) { if (_SOAPService.hasError) {
error = _SOAPService.error; error = _SOAPService.error;
@ -662,7 +662,7 @@ class SOAPViewModel extends BaseViewModel {
} }
PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String? complaintsText, String? medicationText, String? illnessText}) { PostChiefComplaintRequestModel createPostChiefComplaintRequestModel({patientInfo, String? complaintsText, String? medicationText, String? illnessText}) {
return new PostChiefComplaintRequestModel( return PostChiefComplaintRequestModel(
admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null, admissionNo: patientInfo.admissionNo != null ? int.parse(patientInfo.admissionNo) : null,
patientMRN: patientInfo.patientMRN, patientMRN: patientInfo.patientMRN,
episodeID: patientInfo.episodeNo ?? 0, episodeID: patientInfo.episodeNo ?? 0,

@ -1,5 +1,10 @@
import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart'; import 'package:doctor_app_flutter/core/model/referral/DischargeReferralPatient.dart';
import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart'; import 'package:doctor_app_flutter/core/model/referral/MyReferralPatientModel.dart';
import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart'; import 'package:doctor_app_flutter/core/service/patient/DischargedPatientService.dart';
@ -7,57 +12,41 @@ import 'package:doctor_app_flutter/core/service/patient/MyReferralPatientService
import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart'; import 'package:doctor_app_flutter/core/service/patient/ReferralService.dart';
import 'package:doctor_app_flutter/core/service/patient/patient-doctor-referral-service.dart'; import 'package:doctor_app_flutter/core/service/patient/patient-doctor-referral-service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/PendingReferral.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/clinic-doctor.dart';
import 'package:doctor_app_flutter/core/model/patient/my_referral/my_referred_patient_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import '../../locator.dart'; import '../../locator.dart';
class PatientReferralViewModel extends BaseViewModel { class PatientReferralViewModel extends BaseViewModel {
PatientReferralService _referralPatientService = PatientReferralService _referralPatientService = locator<PatientReferralService>();
locator<PatientReferralService>();
ReferralService _referralService = locator<ReferralService>(); ReferralService _referralService = locator<ReferralService>();
MyReferralInPatientService _myReferralService = MyReferralInPatientService _myReferralService = locator<MyReferralInPatientService>();
locator<MyReferralInPatientService>();
DischargedPatientService _dischargedPatientService = DischargedPatientService _dischargedPatientService = locator<DischargedPatientService>();
locator<DischargedPatientService>();
List<DischargeReferralPatient> get myDischargeReferralPatient => List<DischargeReferralPatient> get myDischargeReferralPatient => _dischargedPatientService.myDischargeReferralPatients;
_dischargedPatientService.myDischargeReferralPatients;
List<dynamic> get branchesList => _referralPatientService.projectsList; List<dynamic>? get branchesList => _referralPatientService.projectsList;
List<dynamic> get clinicsList => _referralPatientService.clinicsList; List<dynamic> get clinicsList => _referralPatientService.clinicsList;
List<dynamic> get referralFrequencyList => List<dynamic> get referralFrequencyList => _referralPatientService.frequencyList;
_referralPatientService.frequencyList;
List<dynamic> doctorsList = []; List<dynamic> doctorsList = [];
List<ClinicDoctor> get clinicDoctorsList => List<ClinicDoctor> get clinicDoctorsList => _referralPatientService.doctorsList;
_referralPatientService.doctorsList;
List<MyReferralPatientModel> get myReferralPatients => List<MyReferralPatientModel> get myReferralPatients => _myReferralService.myReferralPatients;
_myReferralService.myReferralPatients;
List<MyReferredPatientModel> get listMyReferredPatientModel => List<MyReferredPatientModel> get listMyReferredPatientModel => _referralPatientService.listMyReferredPatientModel;
_referralPatientService.listMyReferredPatientModel;
List<PendingReferral> get pendingReferral => List<PendingReferral> get pendingReferral => _referralPatientService.pendingReferralList;
_referralPatientService.pendingReferralList;
List<PendingReferral> get patientReferral => List<PendingReferral> get patientReferral => _referralPatientService.patientReferralList;
_referralPatientService.patientReferralList;
List<PatiantInformtion> get patientArrivalList => List<PatiantInformtion> get patientArrivalList => _referralPatientService.patientArrivalList;
_referralPatientService.patientArrivalList;
Future getPatientReferral(PatiantInformtion patient) async { Future getPatientReferral(PatiantInformtion patient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -106,8 +95,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getClinicDoctors( Future getClinicDoctors(PatiantInformtion patient, int clinicId, int branchId) async {
PatiantInformtion patient, int clinicId, int branchId) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _referralPatientService.getDoctorsList(patient, clinicId, branchId); await _referralPatientService.getDoctorsList(patient, clinicId, branchId);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
@ -125,10 +113,7 @@ class PatientReferralViewModel extends BaseViewModel {
Future<dynamic> getDoctorBranch() async { Future<dynamic> getDoctorBranch() async {
DoctorProfileModel doctorProfile = await getDoctorProfile(); DoctorProfileModel doctorProfile = await getDoctorProfile();
if (doctorProfile != null) { if (doctorProfile != null) {
dynamic _selectedBranch = { dynamic _selectedBranch = {"facilityId": doctorProfile.projectID, "facilityName": doctorProfile.projectName};
"facilityId": doctorProfile.projectID,
"facilityName": doctorProfile.projectName
};
return _selectedBranch; return _selectedBranch;
} }
return null; return null;
@ -206,8 +191,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future replay( Future replay(String referredDoctorRemarks, MyReferralPatientModel referral) async {
String referredDoctorRemarks, MyReferralPatientModel referral) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _myReferralService.replay(referredDoctorRemarks, referral); await _myReferralService.replay(referredDoctorRemarks, referral);
if (_myReferralService.hasError) { if (_myReferralService.hasError) {
@ -217,8 +201,7 @@ class PatientReferralViewModel extends BaseViewModel {
getMyReferralPatientService(); getMyReferralPatientService();
} }
Future responseReferral( Future responseReferral(MyReferralPatientModel referralPatient, bool isAccepted) async {
MyReferralPatientModel referralPatient, bool isAccepted) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.responseReferral(referralPatient, isAccepted); await _referralPatientService.responseReferral(referralPatient, isAccepted);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
@ -228,11 +211,9 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future makeReferral(PatiantInformtion patient, String isoStringDate, Future makeReferral(PatiantInformtion patient, String isoStringDate, int projectID, int clinicID, int doctorID, String remarks) async {
int projectID, int clinicID, int doctorID, String remarks) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _referralPatientService.makeReferral( await _referralPatientService.makeReferral(patient, isoStringDate, projectID, clinicID, doctorID, remarks);
patient, isoStringDate, projectID, clinicID, doctorID, remarks);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
error = _referralPatientService.error; error = _referralPatientService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -252,7 +233,7 @@ class PatientReferralViewModel extends BaseViewModel {
String? remarks, String? remarks,
String? ext, String? ext,
bool isLocalBusy = false}) async { bool isLocalBusy = false}) async {
if(isLocalBusy) if (isLocalBusy)
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
else else
setState(ViewState.Busy); setState(ViewState.Busy);
@ -286,8 +267,7 @@ class PatientReferralViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future verifyReferralDoctorRemarks( Future verifyReferralDoctorRemarks(MyReferredPatientModel referredPatient) async {
MyReferredPatientModel referredPatient) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _referralPatientService.verifyReferralDoctorRemarks(referredPatient); await _referralPatientService.verifyReferralDoctorRemarks(referredPatient);
if (_referralPatientService.hasError) { if (_referralPatientService.hasError) {
@ -326,8 +306,7 @@ class PatientReferralViewModel extends BaseViewModel {
} }
} }
PatiantInformtion getPatientFromReferral( PatiantInformtion getPatientFromReferral(MyReferredPatientModel referredPatient) {
MyReferredPatientModel referredPatient) {
PatiantInformtion patient = PatiantInformtion(); PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID; patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName; patient.doctorName = referredPatient.doctorName;
@ -355,8 +334,7 @@ class PatientReferralViewModel extends BaseViewModel {
return patient; return patient;
} }
PatiantInformtion getPatientFromReferralO( PatiantInformtion getPatientFromReferralO(MyReferralPatientModel referredPatient) {
MyReferralPatientModel referredPatient) {
PatiantInformtion patient = PatiantInformtion(); PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID; patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName; patient.doctorName = referredPatient.doctorName;
@ -381,8 +359,7 @@ class PatientReferralViewModel extends BaseViewModel {
return patient; return patient;
} }
PatiantInformtion getPatientFromDischargeReferralPatient( PatiantInformtion getPatientFromDischargeReferralPatient(DischargeReferralPatient referredPatient) {
DischargeReferralPatient referredPatient) {
PatiantInformtion patient = PatiantInformtion(); PatiantInformtion patient = PatiantInformtion();
patient.doctorId = referredPatient.doctorID; patient.doctorId = referredPatient.doctorID;
patient.doctorName = referredPatient.doctorName; patient.doctorName = referredPatient.doctorName;
@ -401,18 +378,15 @@ class PatientReferralViewModel extends BaseViewModel {
patient.roomId = referredPatient.roomID; patient.roomId = referredPatient.roomID;
patient.bedId = referredPatient.bedID; patient.bedId = referredPatient.bedID;
patient.nationalityName = referredPatient.nationalityName; patient.nationalityName = referredPatient.nationalityName;
patient.nationalityFlagURL = patient.nationalityFlagURL = ''; // TODO from backend referredPatient.nationalityFlagURL;
''; // TODO from backend referredPatient.nationalityFlagURL;
patient.age = referredPatient.age; patient.age = referredPatient.age;
patient.clinicDescription = referredPatient.clinicDescription; patient.clinicDescription = referredPatient.clinicDescription;
return patient; return patient;
} }
Future replayReferred(String referredDoctorRemarks, Future replayReferred(String referredDoctorRemarks, MyReferralPatientModel referral, int referralStatus) async {
MyReferralPatientModel referral, int referralStatus) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _myReferralService.replayReferred( await _myReferralService.replayReferred(referredDoctorRemarks, referral, referralStatus);
referredDoctorRemarks, referral, referralStatus);
if (_myReferralService.hasError) { if (_myReferralService.hasError) {
error = _myReferralService.error; error = _myReferralService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);

@ -252,6 +252,7 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authenticationViewModel: authenticationViewModel, authenticationViewModel: authenticationViewModel,
authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!), authMethodType: SelectedAuthMethodTypesService.getMethodsTypeService(authenticationViewModel.user!.logInTypeID!),
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
onShowMore: () {},
)), )),
), ),
Expanded( Expanded(
@ -276,12 +277,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authenticationViewModel: authenticationViewModel, authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.Fingerprint, authMethodType: AuthMethodTypes.Fingerprint,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
onShowMore: () {},
)), )),
Expanded( Expanded(
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel, authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.FaceID, authMethodType: AuthMethodTypes.FaceID,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
onShowMore: () {},
)) ))
], ],
) )
@ -294,12 +297,14 @@ class _VerificationMethodsScreenState extends State<VerificationMethodsScreen> {
authenticationViewModel: authenticationViewModel, authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.SMS, authMethodType: AuthMethodTypes.SMS,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
onShowMore: () {},
)), )),
Expanded( Expanded(
child: VerificationMethodsList( child: VerificationMethodsList(
authenticationViewModel: authenticationViewModel, authenticationViewModel: authenticationViewModel,
authMethodType: AuthMethodTypes.WhatsApp, authMethodType: AuthMethodTypes.WhatsApp,
authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive), authenticateUser: (AuthMethodTypes authMethodType, isActive) => authenticateUser(authMethodType, isActive),
onShowMore: () {},
)) ))
], ],
), ),

@ -72,11 +72,11 @@ class _EndCallScreenState extends State<EndCallScreen> {
DrAppToastMsg.showErrorToast(liveCareModel.error); DrAppToastMsg.showErrorToast(liveCareModel.error);
} else } else
await VideoChannel.openVideoCallScreen( await VideoChannel.openVideoCallScreen(
kToken: liveCareModel.startCallRes.openTokenID, kToken: liveCareModel.startCallRes!.openTokenID,
kSessionId: liveCareModel.startCallRes.openSessionID, kSessionId: liveCareModel.startCallRes!.openSessionID,
kApiKey: '46209962', kApiKey: '46209962',
vcId: patient.vcId!, vcId: patient.vcId!,
isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes.isRecording! : false, isRecording: liveCareModel.startCallRes != null ? liveCareModel.startCallRes!.isRecording! : false,
patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"), patientName: patient.fullName ?? (patient.firstName != null ? "${patient.firstName} ${patient.lastName}" : "-"),
tokenID: await liveCareModel.getToken(), tokenID: await liveCareModel.getToken(),
generalId: GENERAL_ID, generalId: GENERAL_ID,

@ -47,7 +47,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
super.didChangeDependencies(); super.didChangeDependencies();
if (_isInit) { if (_isInit) {
_liveCareProvider = Provider.of<LiveCareViewModel>(context); _liveCareProvider = Provider.of<LiveCareViewModel>(context);
connectOpenTok(widget.model.startCallRes); connectOpenTok(widget.model.startCallRes!);
// widget.model.startCall(vCID: widget.patientData.vcId, isReCall: false); // widget.model.startCall(vCID: widget.patientData.vcId, isReCall: false);
} }
_isInit = false; _isInit = false;

@ -3,25 +3,21 @@ import 'dart:typed_data';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/utils/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher_string.dart';
import '../../locator.dart';
DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = DrAppSharedPreferances();
@ -157,7 +153,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
launch("tel://" + model.pharmaciesList[index]["PhoneNumber"]); launchUrlString("tel://" + model.pharmaciesList[index]["PhoneNumber"]);
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -247,7 +243,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
return Image.memory(base64Decode(base64String)); return Image.memory(base64Decode(base64String));
} }
Uint8List dataFromBase64String(String base64String) { Uint8List dataFromBase64String(String? base64String) {
if (base64String != null) { if (base64String != null) {
return base64Decode(base64String); return base64Decode(base64String);
} else { } else {

@ -19,8 +19,8 @@ class ECGPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String patientType = routeArgs['patient-type']; String patientType = routeArgs['patient-type'] ?? "";
String arrivalType = routeArgs['arrival-type']; String arrivalType = routeArgs['arrival-type'] ?? "";
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PatientMuseViewModel>( return BaseView<PatientMuseViewModel>(
onModelReady: (model) => model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId), onModelReady: (model) => model.getECGPatient(patientType: patient.patientType, patientOutSA: 0, patientID: patient.patientId),

@ -5,18 +5,13 @@ import 'package:flutter/material.dart';
import '../../../../config/config.dart'; import '../../../../config/config.dart';
class PageStepperWidget extends StatelessWidget { class PageStepperWidget extends StatelessWidget {
final int stepsCount; final int stepsCount;
final int currentStepIndex; final int currentStepIndex;
final Size? screenSize; final Size? screenSize;
final List<String>? stepsTitles; final List<String>? stepsTitles;
PageStepperWidget( PageStepperWidget({this.stepsCount = 0, this.currentStepIndex = 0, this.screenSize, this.stepsTitles});
{this.stepsCount = 0,
this.currentStepIndex = 0,
this.screenSize,
this.stepsTitles});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -37,7 +32,7 @@ class PageStepperWidget extends StatelessWidget {
i == stepsCount, i == stepsCount,
i < currentStepIndex, i < currentStepIndex,
dividerWidth, dividerWidth,
stepsTitles: stepsTitles!, stepsTitles: stepsTitles,
) )
else else
StepWidget( StepWidget(
@ -46,7 +41,7 @@ class PageStepperWidget extends StatelessWidget {
i == stepsCount, i == stepsCount,
i < currentStepIndex, i < currentStepIndex,
dividerWidth, dividerWidth,
stepsTitles: stepsTitles!, stepsTitles: stepsTitles,
) )
], ],
) )
@ -64,9 +59,7 @@ class StepWidget extends StatelessWidget {
final double dividerWidth; final double dividerWidth;
final List<String>? stepsTitles; final List<String>? stepsTitles;
StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, StepWidget(this.index, this.isInProgress, this.isFinalStep, this.isStepFinish, this.dividerWidth, {this.stepsTitles});
this.dividerWidth,
{this.stepsTitles});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -110,9 +103,7 @@ class StepWidget extends StatelessWidget {
child: Icon( child: Icon(
Icons.check, Icons.check,
size: 20, size: 20,
color: status == StepStatus.Locked color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.white,
? Color(0xFF969696)
: Colors.white,
)), )),
), ),
if (!isFinalStep) if (!isFinalStep)
@ -120,9 +111,7 @@ class StepWidget extends StatelessWidget {
margin: EdgeInsets.symmetric(horizontal: 4), margin: EdgeInsets.symmetric(horizontal: 4),
width: dividerWidth, width: dividerWidth,
height: 2, height: 2,
color: status == StepStatus.Completed color: status == StepStatus.Completed ? AppGlobal.appGreenColor : Color(0xFFCCCCCC),
? AppGlobal.appGreenColor
: Color(0xFFCCCCCC),
), ),
], ],
), ),
@ -130,9 +119,7 @@ class StepWidget extends StatelessWidget {
height: 8, height: 8,
), ),
AppText( AppText(
stepsTitles == null stepsTitles == null ? "${TranslationBase.of(context).step} $index" : "${stepsTitles![index - 1]}",
? "${TranslationBase.of(context).step} $index"
: "${stepsTitles![index - 1]}",
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black, color: status == StepStatus.Locked ? Color(0xFF969696) : Colors.black,
fontFamily: 'Poppins', fontFamily: 'Poppins',

@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-prof
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'ucaf_detail_screen.dart'; import 'ucaf_detail_screen.dart';
import 'ucaf_input_screen.dart'; import 'ucaf_input_screen.dart';
@ -20,8 +21,7 @@ class UCAFPagerScreen extends StatefulWidget {
_UCAFPagerScreenState createState() => _UCAFPagerScreenState(); _UCAFPagerScreenState createState() => _UCAFPagerScreenState();
} }
class _UCAFPagerScreenState extends State<UCAFPagerScreen> class _UCAFPagerScreenState extends State<UCAFPagerScreen> with TickerProviderStateMixin {
with TickerProviderStateMixin {
PageController? _controller; PageController? _controller;
int _currentIndex = 0; int _currentIndex = 0;
bool _isLoading = true; bool _isLoading = true;
@ -60,73 +60,72 @@ class _UCAFPagerScreenState extends State<UCAFPagerScreen>
final screenSize = MediaQuery.of(context).size; final screenSize = MediaQuery.of(context).size;
return BaseView<UcafViewModel>( return BaseView<UcafViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isLoading: _isLoading, isLoading: _isLoading,
appBar: PatientProfileAppBar(patient!), appBar: PatientProfileAppBar(patient!),
appBarTitle: TranslationBase.of(context).ucaf, appBarTitle: TranslationBase.of(context).ucaf,
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Expanded( Expanded(
child: Container( child: Container(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
ServiceTitle(
ServiceTitle( title: "${TranslationBase.of(context).patient}",
title: "${TranslationBase.of(context).patient}", subTitle: "${TranslationBase.of(context).ucaf}",
subTitle: "${TranslationBase.of(context).ucaf}", ),
), PageStepperWidget(
PageStepperWidget( stepsCount: 2,
stepsCount: 2, currentStepIndex: _currentIndex + 1,
currentStepIndex: _currentIndex + 1, screenSize: screenSize,
screenSize: screenSize, ),
), SizedBox(
SizedBox( height: 10,
height: 10, ),
), Expanded(
Expanded( child: Container(
child: Container( color: Theme.of(context).scaffoldBackgroundColor,
color: Theme.of(context).scaffoldBackgroundColor, child: PageView(
child: PageView( physics: NeverScrollableScrollPhysics(),
physics: NeverScrollableScrollPhysics(), controller: _controller,
controller: _controller, onPageChanged: (index) {
onPageChanged: (index) { setState(() {
setState(() { _currentIndex = index;
_currentIndex = index; });
}); },
}, scrollDirection: Axis.horizontal,
scrollDirection: Axis.horizontal, children: <Widget>[
children: <Widget>[ UCAFInputScreen(
UCAFInputScreen( patient!,
patient!, changeLoadingState: changeLoadingState,
changeLoadingState: changeLoadingState, ),
), UcafDetailScreen(
UcafDetailScreen( patient!,
patient!, model,
model, changeLoadingState: changeLoadingState,
changeLoadingState: changeLoadingState, ),
), ]),
]),
),
),
],
), ),
), ),
), ],
),
],
), ),
bottomSheet: _isLoading ),
? Container( ],
height: 0, ),
) bottomSheet: _isLoading
: UcafButtons(model),),); ? Container(
height: 0,
)
: UcafButtons(model),
),
);
} }
/// TODO Elham* Move to real widget
/// TODO Elham* Move to real widget
Widget UcafButtons(UcafViewModel model) { Widget UcafButtons(UcafViewModel model) {
switch (_currentIndex) { switch (_currentIndex) {
case 0: case 0:

@ -4,7 +4,6 @@ import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -19,8 +18,7 @@ class LabResultHistoryDetailsWidget extends StatefulWidget {
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState(); _VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
} }
class _VitalSignDetailsWidgetState class _VitalSignDetailsWidgetState extends State<LabResultHistoryDetailsWidget> {
extends State<LabResultHistoryDetailsWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
@ -79,33 +77,39 @@ class _VitalSignDetailsWidgetState
List<TableRow> fullData(ProjectViewModel projectViewModel) { List<TableRow> fullData(ProjectViewModel projectViewModel) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
widget.labResultHistory.forEach((vital) { widget.labResultHistory.forEach(
var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!); (vital) {
tableRow.add(TableRow(children: [ var date = AppDateUtils.convertStringToDate(vital.verifiedOnDateTime!);
Container( tableRow.add(
child: Container( TableRow(
padding: EdgeInsets.all(8), children: [
color: Colors.white, Container(
child: AppText( child: Container(
'${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}', padding: EdgeInsets.all(8),
fontSize: SizeConfig.textMultiplier! * 1.8, color: Colors.white,
fontWeight: FontWeight.w600, child: AppText(
), '${projectViewModel.isArabic ? AppDateUtils.getWeekDayArabic(date.weekday) : AppDateUtils.getWeekDay(date.weekday)} ,${date.day} ${projectViewModel.isArabic ? AppDateUtils.getMonthArabic(date.month) : AppDateUtils.getMonth(date.month)} ${date.year}',
), fontSize: SizeConfig.textMultiplier! * 1.8,
), fontWeight: FontWeight.w600,
Container( ),
child: Container( ),
padding: EdgeInsets.all(8), ),
color: Colors.white, Container(
child: AppText( child: Container(
'${vital.resultValue}', padding: EdgeInsets.all(8),
fontSize: SizeConfig.textMultiplier! * 1.8, color: Colors.white,
fontWeight: FontWeight.w600, child: AppText(
), '${vital.resultValue}',
fontSize: SizeConfig.textMultiplier! * 1.8,
fontWeight: FontWeight.w600,
),
),
),
],
), ),
), );
])); },
}); );
return tableRow; return tableRow;
} }
} }

@ -47,8 +47,8 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async { getProgressNoteList(BuildContext context, PatientViewModel model, {bool isLocalBusy = false}) async {
final routeArgs = ModalRoute.of(context)!.settings.arguments as Map; final routeArgs = ModalRoute.of(context)!.settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String? token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); String? type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
print(type); print(type);
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(

@ -158,7 +158,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
children: [ children: [
Column( Column(
children: [ children: [
PatientProfileHeaderNewDesignAppBar(patient, arrivalType ?? '0', patientType!, PatientProfileHeaderNewDesignAppBar(patient, arrivalType!, patientType!,
videoCallDurationStream: videoCallDurationStream, videoCallDurationStream: videoCallDurationStream,
isInpatient: isInpatient, isInpatient: isInpatient,
isFromLiveCare: isFromLiveCare, isFromLiveCare: isFromLiveCare,
@ -356,9 +356,9 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
} else { } else {
await model.getDoctorProfile(); await model.getDoctorProfile();
patient.appointmentNo = int.parse(model.startCallRes.appointmentNo.toString()); patient.appointmentNo = int.parse(model.startCallRes!.appointmentNo.toString());
patient.episodeNo = 0; patient.episodeNo = 0;
model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes.appointmentNo.toString())); model.updateInCallPatient(patient: patient, appointmentNo: int.parse(model.startCallRes!.appointmentNo.toString()));
setState(() { setState(() {
isCallStarted = true; isCallStarted = true;
}); });
@ -367,7 +367,7 @@ class _PatientProfileScreenState extends State<PatientProfileScreen> with Single
context: context, context: context,
onTapGrant: () { onTapGrant: () {
locator<VideoCallService>() locator<VideoCallService>()
.openVideo(model.startCallRes, patient, model.startCallRes != null ? model.startCallRes.isRecording! : true, callConnected, callDisconnected); .openVideo(model.startCallRes!, patient, model.startCallRes != null ? model.startCallRes!.isRecording! : true, callConnected, callDisconnected);
}); });
} }
} }

@ -31,7 +31,6 @@ class ProfileGridForInPatient extends StatelessWidget {
VITAL_SIGN_DETAILS, VITAL_SIGN_DETAILS,
'assets/images/svgs/profile_screen/vital signs.svg', 'assets/images/svgs/profile_screen/vital signs.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab, TranslationBase.of(context).lab,
@ -39,7 +38,6 @@ class ProfileGridForInPatient extends StatelessWidget {
LAB_RESULT, LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg', 'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).lab, TranslationBase.of(context).lab,
@ -47,7 +45,6 @@ class ProfileGridForInPatient extends StatelessWidget {
ALL_SPECIAL_LAB_RESULT, ALL_SPECIAL_LAB_RESULT,
'assets/images/svgs/profile_screen/lab results.svg', 'assets/images/svgs/profile_screen/lab results.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).radiology, TranslationBase.of(context).radiology,
@ -55,7 +52,6 @@ class ProfileGridForInPatient extends StatelessWidget {
RADIOLOGY_PATIENT, RADIOLOGY_PATIENT,
'assets/images/svgs/profile_screen/Radiology.svg', 'assets/images/svgs/profile_screen/Radiology.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
@ -63,7 +59,6 @@ class ProfileGridForInPatient extends StatelessWidget {
ORDER_PRESCRIPTION_OLD, ORDER_PRESCRIPTION_OLD,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patient, TranslationBase.of(context).patient,
@ -71,7 +66,6 @@ class ProfileGridForInPatient extends StatelessWidget {
ORDER_PRESCRIPTION_NEW, ORDER_PRESCRIPTION_NEW,
'assets/images/svgs/profile_screen/order prescription.svg', 'assets/images/svgs/profile_screen/order prescription.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).progress, TranslationBase.of(context).progress,
@ -80,7 +74,6 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/Progress notes.svg', 'assets/images/svgs/profile_screen/Progress notes.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient, isDischargedPatient: isDischargedPatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).order, TranslationBase.of(context).order,
@ -89,7 +82,6 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/order sheets.svg', 'assets/images/svgs/profile_screen/order sheets.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDischargedPatient: isDischargedPatient, isDischargedPatient: isDischargedPatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).orders, TranslationBase.of(context).orders,
@ -105,7 +97,6 @@ class ProfileGridForInPatient extends StatelessWidget {
HEALTH_SUMMARY, HEALTH_SUMMARY,
'assets/images/svgs/profile_screen/health summary.svg', 'assets/images/svgs/profile_screen/health summary.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).medical, TranslationBase.of(context).medical,
@ -114,7 +105,6 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/medical report.svg', 'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: false, isDisable: false,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).referral, TranslationBase.of(context).referral,
@ -123,7 +113,6 @@ class ProfileGridForInPatient extends StatelessWidget {
'assets/images/svgs/profile_screen/refer patient.svg', 'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
isDisable: isDischargedPatient || isFromSearch, isDisable: isDischargedPatient || isFromSearch,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).insurance, TranslationBase.of(context).insurance,
@ -139,7 +128,6 @@ class ProfileGridForInPatient extends StatelessWidget {
DISCHARGE_SUMMARY, DISCHARGE_SUMMARY,
'assets/images/svgs/profile_screen/discharge summary.svg', 'assets/images/svgs/profile_screen/discharge summary.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).patientSick, TranslationBase.of(context).patientSick,
@ -155,7 +143,6 @@ class ProfileGridForInPatient extends StatelessWidget {
GET_OPERATION_REPORT, GET_OPERATION_REPORT,
'assets/images/svgs/profile_screen/operating report.svg', 'assets/images/svgs/profile_screen/operating report.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).pending, TranslationBase.of(context).pending,
@ -163,7 +150,6 @@ class ProfileGridForInPatient extends StatelessWidget {
PENDING_ORDERS, PENDING_ORDERS,
'assets/images/svgs/profile_screen/pending orders.svg', 'assets/images/svgs/profile_screen/pending orders.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).admission, TranslationBase.of(context).admission,
@ -171,7 +157,6 @@ class ProfileGridForInPatient extends StatelessWidget {
ADMISSION_ORDERS, ADMISSION_ORDERS,
'assets/images/svgs/profile_screen/admission req.svg', 'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
"Nursing", "Nursing",
@ -179,7 +164,6 @@ class ProfileGridForInPatient extends StatelessWidget {
NURSING_PROGRESS_NOTE, NURSING_PROGRESS_NOTE,
'assets/images/svgs/profile_screen/Progress notes.svg', 'assets/images/svgs/profile_screen/Progress notes.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).diagnosis, TranslationBase.of(context).diagnosis,
@ -187,7 +171,6 @@ class ProfileGridForInPatient extends StatelessWidget {
DIAGNOSIS_FOR_IN_PATIENT, DIAGNOSIS_FOR_IN_PATIENT,
'assets/images/svgs/profile_screen/diagnosis.svg', 'assets/images/svgs/profile_screen/diagnosis.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).diabetic, TranslationBase.of(context).diabetic,
@ -195,7 +178,6 @@ class ProfileGridForInPatient extends StatelessWidget {
DIABETIC_CHART_VALUES, DIABETIC_CHART_VALUES,
'assets/images/svgs/profile_screen/diabetic chart.svg', 'assets/images/svgs/profile_screen/diabetic chart.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
"VTE", "VTE",
@ -203,7 +185,6 @@ class ProfileGridForInPatient extends StatelessWidget {
VTE_ASSESSMENT, VTE_ASSESSMENT,
'assets/images/svgs/profile_screen/diabetic chart.svg', 'assets/images/svgs/profile_screen/diabetic chart.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
PatientProfileCardModel( PatientProfileCardModel(
TranslationBase.of(context).pharmacy, TranslationBase.of(context).pharmacy,
@ -211,7 +192,6 @@ class ProfileGridForInPatient extends StatelessWidget {
PHARMACY_INTERVENTION, PHARMACY_INTERVENTION,
'assets/images/svgs/profile_screen/medical report.svg', 'assets/images/svgs/profile_screen/medical report.svg',
isInPatient: isInpatient, isInPatient: isInpatient,
//onTap: () {},
), ),
]; ];
@ -219,7 +199,6 @@ class ProfileGridForInPatient extends StatelessWidget {
padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15), padding: const EdgeInsets.symmetric(vertical: 15.0, horizontal: 15),
child: GridView( child: GridView(
shrinkWrap: true, shrinkWrap: true,
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
// if you want IOS bouncing effect, otherwise remove this line // if you want IOS bouncing effect, otherwise remove this line
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
@ -242,9 +221,7 @@ class ProfileGridForInPatient extends StatelessWidget {
isInPatient: item.isInPatient, isInPatient: item.isInPatient,
isDischargedPatient: item.isDischargedPatient, isDischargedPatient: item.isDischargedPatient,
isDisable: item.isDisable, isDisable: item.isDisable,
onTap: () { onTap: item.onTap,
//item.onTap();
},
isLoading: item.isLoading, isLoading: item.isLoading,
); );
}).toList(), }).toList(),

@ -51,14 +51,8 @@ class ProfileGridForOther extends StatelessWidget {
PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg', PatientProfileCardModel(TranslationBase.of(context).patient, TranslationBase.of(context).ucaf, PATIENT_UCAF_REQUEST, 'assets/images/svgs/profile_screen/UCAF.svg',
isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null), isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel( PatientProfileCardModel(TranslationBase.of(context).referral, TranslationBase.of(context).patient, REFER_PATIENT_TO_DOCTOR, 'assets/images/svgs/profile_screen/refer patient.svg',
TranslationBase.of(context).referral, isInPatient: isInpatient, isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null),
TranslationBase.of(context).patient,
REFER_PATIENT_TO_DOCTOR,
'assets/images/svgs/profile_screen/refer patient.svg',
isInPatient: isInpatient,
isDisable: isFromLiveCare ? patient.appointmentNo == null : patient.patientStatusType != 43 || patient.appointmentNo == null,
),
if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0)) if (isFromLiveCare || (patient.appointmentNo != null && patient.appointmentNo != 0))
PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg', PatientProfileCardModel(TranslationBase.of(context).admission, TranslationBase.of(context).request, PATIENT_ADMISSION_REQUEST, 'assets/images/svgs/profile_screen/admission req.svg',
isInPatient: isInpatient, isInPatient: isInpatient,

@ -3,9 +3,8 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher_string.dart';
class RadiologyReportScreen extends StatelessWidget { class RadiologyReportScreen extends StatelessWidget {
final String reportData; final String reportData;
@ -64,7 +63,7 @@ class RadiologyReportScreen extends StatelessWidget {
AppButton( AppButton(
title: TranslationBase.of(context).openRad, title: TranslationBase.of(context).openRad,
onPressed: () async { onPressed: () async {
launch(url); launchUrlString(url);
}, },
), ),
], ],

@ -188,7 +188,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _referTo != null ? _referTo['name'] : null, dropDownText: _referTo != null ? _referTo['name'] : null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: branchError!, validationError: branchError,
onClick: referToList != null onClick: referToList != null
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
@ -238,11 +238,11 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null, dropDownText: _selectedBranch != null ? _selectedBranch['facilityName'] : null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: hospitalError!, validationError: hospitalError,
onClick: model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2 onClick: model.branchesList != null && model.branchesList!.length > 0 && _referTo != null && _referTo['id'] == 2
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList, list: model.branchesList!,
attributeName: 'facilityName', attributeName: 'facilityName',
attributeValueId: 'facilityId', attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
@ -278,7 +278,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null, dropDownText: _selectedClinic != null ? _selectedClinic['ClinicDescription'] : null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: clinicError!, validationError: clinicError,
onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0 onClick: _selectedBranch != null && model.clinicsList != null && model.clinicsList.length > 0
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
@ -319,7 +319,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null, dropDownText: _selectedDoctor != null ? _selectedDoctor['Name'] : null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: doctorError!, validationError: doctorError,
onClick: _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0 onClick: _selectedClinic != null && model.doctorsList != null && model.doctorsList.length > 0
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
@ -362,7 +362,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedPriority != null ? _selectedPriority['Description'] : null, dropDownText: _selectedPriority != null ? _selectedPriority['Description'] : null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: frequencyError!, validationError: frequencyError,
onClick: () { onClick: () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: _priorityList, list: _priorityList,
@ -408,7 +408,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
dropDownText: _selectedFrequency != null ? _selectedFrequency['Description'] : null, dropDownText: _selectedFrequency != null ? _selectedFrequency['Description'] : null,
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: frequencyError!, validationError: frequencyError,
onClick: () { onClick: () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.referralFrequencyList, list: model.referralFrequencyList,
@ -451,7 +451,7 @@ class _PatientMakeInPatientReferralScreenState extends State<PatientMakeInPatien
Stack( Stack(
children: [ children: [
AppTextFieldCustom( AppTextFieldCustom(
validationError: remarkError!, validationError: remarkError,
hintText: "Remarks", hintText: "Remarks",
controller: _remarksController, controller: _remarksController,
inputType: TextInputType.multiline, inputType: TextInputType.multiline,

@ -224,10 +224,10 @@ class _PatientMakeReferralScreenState extends State<PatientMakeReferralScreen> {
enabled: false, enabled: false,
isTextFieldHasSuffix: true, isTextFieldHasSuffix: true,
validationError: hospitalError, validationError: hospitalError,
onClick: model.branchesList != null && model.branchesList.length > 0 && _referTo != null && _referTo['id'] == 2 onClick: model.branchesList != null && model.branchesList!.length > 0 && _referTo != null && _referTo['id'] == 2
? () { ? () {
ListSelectDialog dialog = ListSelectDialog( ListSelectDialog dialog = ListSelectDialog(
list: model.branchesList, list: model.branchesList!,
attributeName: 'facilityName', attributeName: 'facilityName',
attributeValueId: 'facilityId', attributeValueId: 'facilityId',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,

@ -60,7 +60,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn!; typeController.text = projectViewModel.isArabic ? widget.mySelectedAssessment.selectedDiagnosisType!.nameAr! : widget.mySelectedAssessment.selectedDiagnosisType!.nameEn!;
if (widget.mySelectedAssessment.selectedICD != null) icdNameController.text = widget.mySelectedAssessment.selectedICD!.code; if (widget.mySelectedAssessment.selectedICD != null) icdNameController.text = widget.mySelectedAssessment.selectedICD!.code;
} }
InputDecoration textFieldSelectorDecoration(String hintText, String selectedText, bool isDropDown, {IconData? icon, String? validationError}) { InputDecoration textFieldSelectorDecoration(String hintText, String? selectedText, bool isDropDown, {IconData? icon, String? validationError}) {
return new InputDecoration( return new InputDecoration(
fillColor: Colors.white, fillColor: Colors.white,
contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10), contentPadding: EdgeInsets.symmetric(vertical: 15, horizontal: 10),
@ -161,7 +161,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
if (icdNameController.text.length <= 3) { if (icdNameController.text.length <= 3) {
DrAppToastMsg.showErrorToast("Please enter 4 or more characters"); DrAppToastMsg.showErrorToast("Please enter 4 or more characters");
} else { } else {
model.listOfICD10.clear(); model.listOfICD10!.clear();
model.callAddAssessmentLookupsServices(searchKey: icdNameController.text); model.callAddAssessmentLookupsServices(searchKey: icdNameController.text);
} }
}, },
@ -172,20 +172,20 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onFieldSubmitted: () {}, onFieldSubmitted: () {},
)), )),
model.listOfICD10.length > 0 && icdNameController.text.isNotEmpty model.listOfICD10!.length > 0 && icdNameController.text.isNotEmpty
? Container( ? Container(
color: Colors.white, color: Colors.white,
height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height, height: MediaQuery.of(context).size.height * 0.4, //height to 9% of screen height,
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
itemCount: model.listOfICD10.length, itemCount: model.listOfICD10!.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return InkWell( return InkWell(
child: ListTile(title: AppText(model.listOfICD10[index].description + " / " + model.listOfICD10[index].code.toString(), fontSize: 12.0)), child: ListTile(title: AppText(model.listOfICD10![index].description + " / " + model.listOfICD10![index].code.toString(), fontSize: 12.0)),
onTap: () { onTap: () {
widget.mySelectedAssessment.selectedICD = model.listOfICD10[index]; widget.mySelectedAssessment.selectedICD = model.listOfICD10![index];
icdNameController.text = model.listOfICD10[index].description; icdNameController.text = model.listOfICD10![index].description;
model.listOfICD10.clear(); model.listOfICD10!.clear();
setState(() {}); setState(() {});
}); });
}, },
@ -264,9 +264,9 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onClick: model.listOfDiagnosisCondition != null onClick: model.listOfDiagnosisCondition != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisCondition, list: model.listOfDiagnosisCondition!,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition!, selectedValue: widget.mySelectedAssessment.selectedDiagnosisCondition,
okFunction: (MasterKeyModel selectedValue) { okFunction: (MasterKeyModel selectedValue) {
setState(() { setState(() {
widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue; widget.mySelectedAssessment.selectedDiagnosisCondition = selectedValue;
@ -303,7 +303,7 @@ class _AddAssessmentDetailsState extends State<AddAssessmentDetails> {
onClick: model.listOfDiagnosisType != null onClick: model.listOfDiagnosisType != null
? () { ? () {
MasterKeyDailog dialog = MasterKeyDailog( MasterKeyDailog dialog = MasterKeyDailog(
list: model.listOfDiagnosisType, list: model.listOfDiagnosisType!,
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
selectedValue: widget.mySelectedAssessment.selectedDiagnosisType!, selectedValue: widget.mySelectedAssessment.selectedDiagnosisType!,
okFunction: (MasterKeyModel selectedValue) { okFunction: (MasterKeyModel selectedValue) {

@ -19,7 +19,7 @@ class AddExaminationWidget extends StatefulWidget {
final bool Function(MasterKeyModel)? isServiceSelected; final bool Function(MasterKeyModel)? isServiceSelected;
bool isExpand; bool isExpand;
final Function? expandClick; final Function() expandClick;
final List<MySelectedExamination>? mySelectedExamination; final List<MySelectedExamination>? mySelectedExamination;
AddExaminationWidget({ AddExaminationWidget({
@ -28,7 +28,7 @@ class AddExaminationWidget extends StatefulWidget {
this.addExamination, this.addExamination,
this.isServiceSelected, this.isServiceSelected,
this.isExpand = false, this.isExpand = false,
this.expandClick, required this.expandClick,
this.mySelectedExamination, this.mySelectedExamination,
}); });
@ -44,10 +44,10 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
@override @override
void initState() { void initState() {
if (getSelectedExam(widget.item!) != null) { if (getSelectedExam(widget.item!) != null) {
examination = getSelectedExam(widget.item!); examination = getSelectedExam(widget.item!)!;
status = examination.isNormal! status = examination.isNormal
? 1 ? 1
: examination.isAbnormal! : examination.isAbnormal
? 2 ? 2
: 3; : 3;
remarksController.text = examination.remark!; remarksController.text = examination.remark!;
@ -96,8 +96,8 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 8), margin: EdgeInsets.symmetric(horizontal: 8),
child: InkWell( child: InkWell(
onTap: widget.expandClick!(), onTap: widget.expandClick,
child: Icon(widget.isExpand! ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down), child: Icon(widget.isExpand ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down),
), ),
), ),
], ],
@ -264,23 +264,23 @@ class _AddExaminationWidgetState extends State<AddExaminationWidget> {
setState(() { setState(() {
if (widget.isServiceSelected!(widget.item!)) { if (widget.isServiceSelected!(widget.item!)) {
if (examination.isLocal) widget.removeExamination!(examination); if (examination.isLocal) widget.removeExamination!(examination);
widget.expandClick!(); widget.expandClick;
} else { } else {
examination.isNormal = status == 1; examination.isNormal = status == 1;
examination.isAbnormal = status == 2; examination.isAbnormal = status == 2;
examination.notExamined = status == 3; examination.notExamined = status == 3;
examination.remark = remarksController.text; examination.remark = remarksController.text;
widget.addExamination!(examination); widget.addExamination!(examination);
widget.expandClick!(); widget.expandClick;
} }
}); });
} }
MySelectedExamination getSelectedExam(MasterKeyModel masterKey) { MySelectedExamination? getSelectedExam(MasterKeyModel masterKey) {
Iterable<MySelectedExamination> exam = widget.mySelectedExamination!.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId); Iterable<MySelectedExamination> exam = widget.mySelectedExamination!.where((element) => masterKey.id == element.selectedExamination!.id && masterKey.typeId == element.selectedExamination!.typeId);
if (exam.length > 0) { if (exam.length > 0) {
return exam.first; return exam.first;
} }
return MySelectedExamination(); return null;
} }
} }

@ -34,10 +34,10 @@ class AddMedication extends StatefulWidget {
} }
class _AddMedicationState extends State<AddMedication> { class _AddMedicationState extends State<AddMedication> {
MasterKeyModel _selectedMedicationDose = MasterKeyModel(); MasterKeyModel? _selectedMedicationDose;
MasterKeyModel _selectedMedicationStrength = MasterKeyModel(); MasterKeyModel? _selectedMedicationStrength;
MasterKeyModel _selectedMedicationRoute = MasterKeyModel(); MasterKeyModel? _selectedMedicationRoute;
MasterKeyModel _selectedMedicationFrequency = MasterKeyModel(); MasterKeyModel? _selectedMedicationFrequency;
TextEditingController doseController = TextEditingController(); TextEditingController doseController = TextEditingController();
TextEditingController strengthController = TextEditingController(); TextEditingController strengthController = TextEditingController();
@ -45,7 +45,7 @@ class _AddMedicationState extends State<AddMedication> {
TextEditingController frequencyController = TextEditingController(); TextEditingController frequencyController = TextEditingController();
GetMedicationResponseModel? _selectedMedication; GetMedicationResponseModel? _selectedMedication;
GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = new GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
bool isFormSubmitted = false; bool isFormSubmitted = false;
@override @override
@ -101,7 +101,7 @@ class _AddMedicationState extends State<AddMedication> {
decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, "", true, suffixIcon: Icons.search), decoration: TextFieldsUtils.textFieldSelectorDecoration(TranslationBase.of(context).searchMedicineNameHere, "", true, suffixIcon: Icons.search),
itemSubmitted: (item) => setState(() => _selectedMedication = item), itemSubmitted: (item) => setState(() => _selectedMedication = item),
key: key, key: key,
suggestions: model.allMedicationList, suggestions: model.allMedicationList!,
itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description! + '/' + suggestion.genericName!), padding: EdgeInsets.all(8.0)), itemBuilder: (context, suggestion) => new Padding(child: AppText(suggestion.description! + '/' + suggestion.genericName!), padding: EdgeInsets.all(8.0)),
itemSorter: (a, b) => 1, itemSorter: (a, b) => 1,
itemFilter: (suggestion, input) => itemFilter: (suggestion, input) =>
@ -165,7 +165,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() { setState(() {
_selectedMedicationDose = selectedValue; _selectedMedicationDose = selectedValue;
doseController.text = projectViewModel.isArabic ? _selectedMedicationDose.nameAr! : _selectedMedicationDose.nameEn!; doseController.text = projectViewModel.isArabic ? _selectedMedicationDose!.nameAr! : _selectedMedicationDose!.nameEn!;
}); });
}, },
); );
@ -204,7 +204,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() { setState(() {
_selectedMedicationStrength = selectedValue; _selectedMedicationStrength = selectedValue;
strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength.nameAr! : _selectedMedicationStrength.nameEn!; strengthController.text = projectViewModel.isArabic ? _selectedMedicationStrength!.nameAr! : _selectedMedicationStrength!.nameEn!;
}); });
}, },
); );
@ -245,7 +245,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() { setState(() {
_selectedMedicationRoute = selectedValue; _selectedMedicationRoute = selectedValue;
routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute.nameAr! : _selectedMedicationRoute.nameEn!; routeController.text = projectViewModel.isArabic ? _selectedMedicationRoute!.nameAr! : _selectedMedicationRoute!.nameEn!;
}); });
}, },
); );
@ -284,7 +284,7 @@ class _AddMedicationState extends State<AddMedication> {
setState(() { setState(() {
_selectedMedicationFrequency = selectedValue; _selectedMedicationFrequency = selectedValue;
frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency.nameAr! : _selectedMedicationFrequency.nameEn!; frequencyController.text = projectViewModel.isArabic ? _selectedMedicationFrequency!.nameAr! : _selectedMedicationFrequency!.nameEn!;
}); });
}, },
); );

@ -95,7 +95,7 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage> implements
if (model.patientAllergiesList.isNotEmpty) { if (model.patientAllergiesList.isNotEmpty) {
model.patientAllergiesList.forEach((element) { model.patientAllergiesList.forEach((element) {
MasterKeyModel? selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); MasterKeyModel? selectedAllergy = model.getOneMasterKey(masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType);
MasterKeyModel selectedAllergySeverity; MasterKeyModel? selectedAllergySeverity;
if (element.severity == 0) { if (element.severity == 0) {
selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: ''); selectedAllergySeverity = MasterKeyModel(id: 0, typeId: MasterKeysService.AllergySeverity.getMasterKeyService(), nameAr: '', nameEn: '');
} else { } else {

@ -45,7 +45,7 @@ class _AddPrescriptionState extends State<AddPrescription> {
final myController = TextEditingController(); final myController = TextEditingController();
DateTime? selectedDate; DateTime? selectedDate;
int strengthChar = 0; int strengthChar = 0;
GetMedicationResponseModel? _selectedMedication; GetMedicationResponseModel _selectedMedication = GetMedicationResponseModel();
MedicineViewModel? medicineViewModel; MedicineViewModel? medicineViewModel;
GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>(); GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>> key = GlobalKey<AutoCompleteTextFieldState<GetMedicationResponseModel>>();
@ -138,7 +138,7 @@ class _AddPrescriptionState extends State<AddPrescription> {
prescriptionViewModel: widget.prescriptionViewModel, prescriptionViewModel: widget.prescriptionViewModel,
medicineViewModel: model, medicineViewModel: model,
prescriptionList: widget.prescriptionList, prescriptionList: widget.prescriptionList,
selectedMedication: _selectedMedication!, selectedMedication: _selectedMedication,
), ),
], ],
), ),

@ -1,12 +1,12 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import '../../../config/config.dart'; import '../../../config/config.dart';
import '../../../core/model/search_drug/get_medication_response_model.dart'; import '../../../core/model/search_drug/get_medication_response_model.dart';
import '../../../core/viewModel/medicine_view_model.dart'; import '../../../core/viewModel/medicine_view_model.dart';
import '../../../core/viewModel/prescription/prescription_view_model.dart'; import '../../../core/viewModel/prescription/prescription_view_model.dart';
import '../../../utils/utils.dart';
import '../../../utils/translations_delegate_base_utils.dart'; import '../../../utils/translations_delegate_base_utils.dart';
import '../../../utils/utils.dart';
import '../../../widgets/medicine/medicine_item_widget.dart'; import '../../../widgets/medicine/medicine_item_widget.dart';
import '../../../widgets/shared/buttons/app_buttons_widget.dart'; import '../../../widgets/shared/buttons/app_buttons_widget.dart';
import '../../../widgets/shared/loader/gif_loader_dialog_utils.dart'; import '../../../widgets/shared/loader/gif_loader_dialog_utils.dart';
@ -41,9 +41,9 @@ class SearchPrescriptionWidget extends StatelessWidget {
widthFactor: 0.9, widthFactor: 0.9,
child: Container( child: Container(
decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))), decoration: BoxDecoration(borderRadius: BorderRadius.all(Radius.circular(6.0)), border: Border.all(width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.all(10), padding: EdgeInsets.all(6),
child: AppTextFormField( child: AppTextFormField(
borderColor: Colors.white, borderColor: Colors.transparent,
hintText: TranslationBase.of(context).searchMedicineNameHere, hintText: TranslationBase.of(context).searchMedicineNameHere,
controller: myController, controller: myController,
onSaved: (value) {}, onSaved: (value) {},

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart'; import 'package:doctor_app_flutter/screens/procedures/base_add_procedure_tab_page.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart';
@ -12,8 +12,8 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../utils/utils.dart'; import '../../utils/utils.dart';
import '../../widgets/shared/errors/error_message.dart'; import '../../widgets/shared/errors/error_message.dart';
@ -26,8 +26,7 @@ class NewPrescriptionsPage extends StatelessWidget {
bool isFromLiveCare = routeArgs['isFromLiveCare']; bool isFromLiveCare = routeArgs['isFromLiveCare'];
return BaseView<PrescriptionViewModel>( return BaseView<PrescriptionViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
model.getPrescriptionListNew( model.getPrescriptionListNew(mrn: patient.patientMRN, appNo: patient.appointmentNo ?? 0);
mrn: patient.patientMRN, appNo: patient.appointmentNo);
}, },
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
@ -58,9 +57,7 @@ class NewPrescriptionsPage extends StatelessWidget {
], ],
), ),
), ),
if ((patient.patientStatusType != null && if ((patient.patientStatusType != null && patient.patientStatusType == 43) || (isFromLiveCare && patient.appointmentNo != null))
patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () { onTap: () {
Navigator.push( Navigator.push(
@ -74,8 +71,7 @@ class NewPrescriptionsPage extends StatelessWidget {
settingRoute: 'AddProcedureTabPage'), settingRoute: 'AddProcedureTabPage'),
); );
}, },
label: TranslationBase.of(context) label: TranslationBase.of(context).applyForNewPrescriptionsOrder,
.applyForNewPrescriptionsOrder,
), ),
Center( Center(
child: FractionallySizedBox( child: FractionallySizedBox(
@ -86,80 +82,63 @@ class NewPrescriptionsPage extends StatelessWidget {
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return InkWell( return InkWell(
child: CardWithBgWidget( child: CardWithBgWidget(
bgColor: Colors.transparent, bgColor: Colors.transparent,
widget: Column( widget: Column(
children: [ children: [
CustomRow( CustomRow(
label: "", label: "",
value: Utils.convertToTitleCase(model value: Utils.convertToTitleCase(model.prescriptionListNew[index].medicationName),
.prescriptionListNew[index] valueSize: SizeConfig.getTextMultiplierBasedOnWidth() * 3.5,
.medicationName), ),
valueSize: SizeConfig SizedBox(
.getTextMultiplierBasedOnWidth() * height: 10,
3.5, ),
), CustomRow(
SizedBox( label: TranslationBase.of(context).doctorName + ': ', //"Doctor Name :",
height: 10, value: model.prescriptionListNew[index].doctorName,
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).doctorName + ': ', //"Doctor Name :", label: TranslationBase.of(context).orderTypeDescription + ': ', //"Order Type Description :",
value: model value: model.prescriptionListNew[index].orderTypeDescription,
.prescriptionListNew[index].doctorName, ),
), CustomRow(
CustomRow( label: TranslationBase.of(context).status + ': ',
label: TranslationBase.of(context).orderTypeDescription + ': ',//"Order Type Description :", value: model.prescriptionListNew[index].status,
value: model.prescriptionListNew[index] ),
.orderTypeDescription, CustomRow(
), label: TranslationBase.of(context).indication + ': ', //"indication :",
CustomRow( value: model.prescriptionListNew[index].indication,
label: TranslationBase.of(context).status + ': ', ),
value: CustomRow(
model.prescriptionListNew[index].status, label: TranslationBase.of(context).doseDetails + ': ', //"doseDetail :",
), value: model.prescriptionListNew[index].doseDetail,
CustomRow( ),
label: TranslationBase.of(context).indication + ': ', //"indication :", CustomRow(
value: model label: TranslationBase.of(context).quantity + ': ', //"quantity :",
.prescriptionListNew[index].indication, value: model.prescriptionListNew[index].quantity.toString(),
), ),
CustomRow( CustomRow(
label: TranslationBase.of(context).doseDetails + ': ', //"doseDetail :", label: TranslationBase.of(context).startDate + ': ', //"start Date :",
value: model value: model.prescriptionListNew[index].startDate.toString(),
.prescriptionListNew[index].doseDetail, ),
), CustomRow(
CustomRow( label: TranslationBase.of(context).stopDate + ': ', //"stop Date :",
label: TranslationBase.of(context).quantity + ': ',//"quantity :", value: model.prescriptionListNew[index].stopDate.toString(),
value: model ),
.prescriptionListNew[index].quantity if (model.prescriptionListNew[index].remarks != null && model.prescriptionListNew[index].remarks != "")
.toString(), CustomRow(
),CustomRow( label: TranslationBase.of(context).remarks + ': ', //"Remark :",
label: TranslationBase.of(context).startDate + ': ', //"start Date :", value: model.prescriptionListNew[index].remarks.toString(),
value: model ),
.prescriptionListNew[index].startDate ],
.toString(), ),
),CustomRow(
label: TranslationBase.of(context).stopDate + ': ',//"stop Date :",
value: model
.prescriptionListNew[index].stopDate
.toString(),
),
if(model
.prescriptionListNew[index].remarks != null&& model
.prescriptionListNew[index].remarks!= "")
CustomRow(
label: TranslationBase.of(context).remarks + ': ',//"Remark :",
value: model
.prescriptionListNew[index].remarks
.toString(),
),
],
), ),
),); );
}), }),
), ),
), ),
if (model.prescriptionListNew.isEmpty && if (model.prescriptionListNew.isEmpty && patient.patientStatusType != 43)
patient.patientStatusType != 43)
Center( Center(
child: ErrorMessage( child: ErrorMessage(
error: TranslationBase.of(context).noPrescriptionsFound, error: TranslationBase.of(context).noPrescriptionsFound,

@ -9,14 +9,13 @@ import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart'; import 'package:doctor_app_flutter/widgets/shared/user-guid/CusomRow.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
/// TODO Roaa Add translation and make sure it working fine /// TODO Roaa Add translation and make sure it working fine
class ProcedureCard extends StatelessWidget { class ProcedureCard extends StatelessWidget {
final Function? onTap; final Function()? onTap;
final EntityList? entityList; final EntityList? entityList;
final String? categoryName; final String? categoryName;
final int? categoryID; final int? categoryID;
@ -59,15 +58,12 @@ class ProcedureCard extends StatelessWidget {
topLeft: Radius.circular(10), topLeft: Radius.circular(10),
bottomLeft: Radius.circular(10), bottomLeft: Radius.circular(10),
), ),
color: color: entityList!.orderType == 0 ? Colors.black : Colors.red[500],
entityList!.orderType == 0 ? Colors.black : Colors.red[500],
), ),
), ),
Expanded( Expanded(
child: Container( child: Container(
padding: EdgeInsets.only( padding: EdgeInsets.only(left: projectViewModel.isArabic ? 0 : 15, right: projectViewModel.isArabic ? 15 : 0),
left: projectViewModel.isArabic ? 0 : 15,
right: projectViewModel.isArabic ? 15 : 0),
child: InkWell( child: InkWell(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
@ -80,20 +76,15 @@ class ProcedureCard extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
entityList!.orderType == 0 entityList!.orderType == 0 ? 'Routine' : 'Urgent',
? 'Routine' color: entityList!.orderType == 0 ? Colors.black : AppGlobal.appRedColor,
: 'Urgent',
color: entityList!.orderType == 0
? Colors.black
: AppGlobal.appRedColor,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
AppText( AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase(entityList!.procedureName!),
entityList!.procedureName!),
bold: true, bold: true,
fontSize: 14, fontSize: 14,
), ),
@ -109,8 +100,7 @@ class ProcedureCard extends StatelessWidget {
children: [ children: [
AppText( AppText(
'${AppDateUtils.getDayMonthYearDateFormatted( '${AppDateUtils.getDayMonthYearDateFormatted(
AppDateUtils.convertISOStringToDateTime( AppDateUtils.convertISOStringToDateTime(entityList!.createdOn!),
entityList!.createdOn!),
isMonthShort: true, isMonthShort: true,
isArabic: projectViewModel.isArabic, isArabic: projectViewModel.isArabic,
)}', )}',
@ -145,8 +135,7 @@ class ProcedureCard extends StatelessWidget {
), ),
), ),
Container( Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 0, top: 25, right: 0, bottom: 0),
left: 0, top: 25, right: 0, bottom: 0),
padding: EdgeInsets.only(left: 4.0, right: 4.0), padding: EdgeInsets.only(left: 4.0, right: 4.0),
child: Container( child: Container(
width: 40, width: 40,
@ -157,9 +146,7 @@ class ProcedureCard extends StatelessWidget {
'assets/images/dr_avatar.png', 'assets/images/dr_avatar.png',
height: 25, height: 25,
width: 30, width: 30,
errorBuilder: (BuildContext context, errorBuilder: (BuildContext context, Object exception, StackTrace? stackTrace) {
Object exception,
StackTrace? stackTrace) {
return Text('No Image'); return Text('No Image');
}, },
))), ))),
@ -167,14 +154,12 @@ class ProcedureCard extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 10, top: 25, right: 10, bottom: 0),
left: 10, top: 25, right: 10, bottom: 0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase(entityList!.doctorName!),
entityList!.doctorName!),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: 1.7 * SizeConfig.textMultiplier!, fontSize: 1.7 * SizeConfig.textMultiplier!,
@ -182,12 +167,10 @@ class ProcedureCard extends StatelessWidget {
), ),
if (entityList!.clinicDescription != null) if (entityList!.clinicDescription != null)
AppText( AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase(entityList!.clinicDescription!),
entityList!.clinicDescription!),
fontFamily: 'Poppins', fontFamily: 'Poppins',
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: 1.4 * SizeConfig.textMultiplier!,
1.4 * SizeConfig.textMultiplier!,
color: Color(0XFF2E303A), color: Color(0XFF2E303A),
), ),
], ],
@ -203,20 +186,14 @@ class ProcedureCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
entityList!.remarks != null entityList!.remarks != null ? Utils.convertToTitleCase(entityList!.remarks.toString()) : '',
? Utils.convertToTitleCase(
entityList!.remarks.toString())
: '',
fontSize: 12, fontSize: 12,
), ),
), ),
if ((entityList!.categoryID == 2 || if ((entityList!.categoryID == 2 || entityList!.categoryID == 4) && doctorID == entityList!.doctorID && !isInpatient!)
entityList!.categoryID == 4) &&
doctorID == entityList!.doctorID &&
!isInpatient!)
InkWell( InkWell(
child: Icon(DoctorApp.edit), child: Icon(DoctorApp.edit),
onTap: onTap!(), onTap: onTap,
) )
], ],
), ),

@ -10,20 +10,13 @@ import 'package:provider/provider.dart';
class VerificationMethodsList extends StatefulWidget { class VerificationMethodsList extends StatefulWidget {
final AuthMethodTypes? authMethodType; final AuthMethodTypes? authMethodType;
final Function(AuthMethodTypes type, bool isActive)? authenticateUser; final Function(AuthMethodTypes type, bool isActive)? authenticateUser;
final Function? onShowMore; final Function() onShowMore;
final AuthenticationViewModel? authenticationViewModel; final AuthenticationViewModel? authenticationViewModel;
const VerificationMethodsList( const VerificationMethodsList({Key? key, this.authMethodType, this.authenticateUser, required this.onShowMore, this.authenticationViewModel}) : super(key: key);
{Key? key,
this.authMethodType,
this.authenticateUser,
this.onShowMore,
this.authenticationViewModel})
: super(key: key);
@override @override
_VerificationMethodsListState createState() => _VerificationMethodsListState createState() => _VerificationMethodsListState();
_VerificationMethodsListState();
} }
class _VerificationMethodsListState extends State<VerificationMethodsList> { class _VerificationMethodsListState extends State<VerificationMethodsList> {
@ -38,51 +31,44 @@ class _VerificationMethodsListState extends State<VerificationMethodsList> {
case AuthMethodTypes.WhatsApp: case AuthMethodTypes.WhatsApp:
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg', assetPath: 'assets/images/svgs/verification/verify-whtsapp.svg',
onTap: () => onTap: () => {widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)},
{widget.authenticateUser!(AuthMethodTypes.WhatsApp, true)}, label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifyWhatsApp,
label: TranslationBase.of(context).verifyWith +
TranslationBase.of(context).verifyWhatsApp,
); );
break; break;
case AuthMethodTypes.SMS: case AuthMethodTypes.SMS:
return MethodTypeCard( return MethodTypeCard(
assetPath: "assets/images/svgs/verification/verify-sms.svg", assetPath: "assets/images/svgs/verification/verify-sms.svg",
onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)}, onTap: () => {widget.authenticateUser!(AuthMethodTypes.SMS, true)},
label: TranslationBase.of(context).verifyWith + label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifySMS,
TranslationBase.of(context).verifySMS,
); );
break; break;
case AuthMethodTypes.Fingerprint: case AuthMethodTypes.Fingerprint:
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/svgs/verification/verify-finger.svg', assetPath: 'assets/images/svgs/verification/verify-finger.svg',
onTap: () async { onTap: () async {
if (await widget.authenticationViewModel! if (await widget.authenticationViewModel!.checkIfBiometricAvailable(BiometricType.fingerprint)) {
.checkIfBiometricAvailable(BiometricType.fingerprint)) {
widget.authenticateUser!(AuthMethodTypes.Fingerprint, true); widget.authenticateUser!(AuthMethodTypes.Fingerprint, true);
} }
}, },
label: TranslationBase.of(context).verifyWith + label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifyFingerprint,
TranslationBase.of(context).verifyFingerprint,
); );
break; break;
case AuthMethodTypes.FaceID: case AuthMethodTypes.FaceID:
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/svgs/verification/verify-face.svg', assetPath: 'assets/images/svgs/verification/verify-face.svg',
onTap: () async { onTap: () async {
if (await widget.authenticationViewModel! if (await widget.authenticationViewModel!.checkIfBiometricAvailable(BiometricType.face)) {
.checkIfBiometricAvailable(BiometricType.face)) {
widget.authenticateUser!(AuthMethodTypes.FaceID, true); widget.authenticateUser!(AuthMethodTypes.FaceID, true);
} }
}, },
label: TranslationBase.of(context).verifyWith + label: TranslationBase.of(context).verifyWith + TranslationBase.of(context).verifyFaceID,
TranslationBase.of(context).verifyFaceID,
); );
break; break;
default: default:
return MethodTypeCard( return MethodTypeCard(
assetPath: 'assets/images/login/more_icon.png', assetPath: 'assets/images/login/more_icon.png',
onTap: widget.onShowMore!(), onTap: widget.onShowMore,
isSvg: false, isSvg: false,
label: TranslationBase.of(context).moreVerification, label: TranslationBase.of(context).moreVerification,
height: 0, height: 0,

@ -42,7 +42,7 @@ class PatientProfileButton extends StatelessWidget {
this.icon, this.icon,
this.route, this.route,
this.isDisable = false, this.isDisable = false,
required this.onTap, this.onTap,
this.isLoading = false, this.isLoading = false,
this.from, this.from,
this.to, this.to,
@ -66,7 +66,7 @@ class PatientProfileButton extends StatelessWidget {
onTap: isDisable onTap: isDisable
? null ? null
: onTap != null : onTap != null
? onTap!() ? onTap
: () { : () {
navigator(context, this.route); navigator(context, this.route);
}, },

@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher_string.dart';
import '../large_avatar.dart'; import '../large_avatar.dart';
import 'header_row.dart'; import 'header_row.dart';
@ -86,7 +86,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge
icon: Icon(Icons.arrow_back_ios), icon: Icon(Icons.arrow_back_ios),
color: Color(0xFF2B353E), //Colors.black, color: Color(0xFF2B353E), //Colors.black,
onPressed: () { onPressed: () {
if (onPressed != null) onPressed!(); if (onPressed != null) onPressed;
Navigator.pop(context); Navigator.pop(context);
}, },
), ),
@ -115,7 +115,7 @@ class PatientProfileAppBar extends StatelessWidget implements PreferredSizeWidge
margin: EdgeInsets.symmetric(horizontal: 4), margin: EdgeInsets.symmetric(horizontal: 4),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
launch("tel://" + patient.mobileNumber!); launchUrlString("tel://" + patient.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,

@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher_string.dart';
import 'header_row.dart'; import 'header_row.dart';
@ -91,7 +91,7 @@ class PatientProfileHeaderNewDesignAppBar extends StatelessWidget implements Pre
eventCategory: "Patient Profile Header", eventCategory: "Patient Profile Header",
eventAction: "Call Patient", eventAction: "Call Patient",
); );
launch("tel://" + patient.mobileNumber!); launchUrlString("tel://" + patient.mobileNumber!);
}, },
child: Icon( child: Icon(
Icons.phone, Icons.phone,

Loading…
Cancel
Save