Compare commits

..

No commits in common. 'development' and 'fix_refere_desgin' have entirely different histories.

@ -40,12 +40,10 @@ class BaseAppClient {
try { try {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE); Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
if (profile != null) { if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) { if (body['DoctorID'] == null)
body['DoctorID'] = doctorProfile?.doctorID; body['DoctorID'] = doctorProfile?.doctorID;
}
if (body['DoctorID'] == "") body['DoctorID'] = null; if (body['DoctorID'] == "") body['DoctorID'] = null;
if (body['EditedBy'] == null) if (body['EditedBy'] == null)
body['EditedBy'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID;
@ -55,19 +53,17 @@ class BaseAppClient {
if (body['ClinicID'] == null) if (body['ClinicID'] == null)
body['ClinicID'] = doctorProfile?.clinicID; body['ClinicID'] = doctorProfile?.clinicID;
} else { }
String doctorID = await sharedPref.getString(DOCTOR_ID);
if (body['DoctorID'] == '') { if (body['DoctorID'] == '') {
body['DoctorID'] = null; body['DoctorID'] = null;
} else if (doctorID != null) body['DoctorID'] = int.parse(doctorID);
} }
if (body['EditedBy'] == '') { if (body['EditedBy'] == '') {
body.remove("EditedBy"); body.remove("EditedBy");
} }
if (body['TokenID'] == null) { if (body['TokenID'] == null) {
body['TokenID'] = token ?? ''; body['TokenID'] = token ?? '';
} }
// body['TokenID'] = "@dm!n" ?? '';
if (!isFallLanguage) { if (!isFallLanguage) {
String lang = await sharedPref.getString(APP_Language); String lang = await sharedPref.getString(APP_Language);
@ -77,6 +73,7 @@ class BaseAppClient {
body['LanguageID'] = 2; body['LanguageID'] = 2;
} }
body['stamp'] = DateTime.now().toIso8601String(); body['stamp'] = DateTime.now().toIso8601String();
// if(!body.containsKey("IPAdress"))
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
if (body['VersionID'] == null) { if (body['VersionID'] == null) {
body['VersionID'] = VERSION_ID; body['VersionID'] = VERSION_ID;
@ -176,14 +173,6 @@ class BaseAppClient {
}; };
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile);
if (body['DoctorID'] == null) {
body['DoctorID'] = doctorProfile?.doctorID;
}
}
var languageID = var languageID =
await sharedPref.getStringWithDefaultValue(APP_Language, 'en'); await sharedPref.getStringWithDefaultValue(APP_Language, 'en');
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
@ -231,7 +220,7 @@ class BaseAppClient {
: PATIENT_TYPE_ID : PATIENT_TYPE_ID
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
body['TokenID'] = body.containsKey('TokenID') ? body['TokenID']??token : token; body['TokenID'] = body.containsKey('TokenID') ? body['TokenID'] : token;
body['PatientID'] = body['PatientID'] != null body['PatientID'] = body['PatientID'] != null
? body['PatientID'] ? body['PatientID']
: patient.patientId ?? patient.patientMRN; : patient.patientId ?? patient.patientMRN;

@ -384,10 +384,6 @@ const SET_ACCEPTED_OR_REJECTED =
const GET_STP_MASTER_LIST = const GET_STP_MASTER_LIST =
"Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList"; "Services/DoctorApplication.svc/REST/DoctorApp_GetSTPMasterList";
const DOCTOR_ER_SIGN_ASSESSMENT =
"Services/DoctorApplication.svc/REST/DoctorApp_DoctorERSignAssessment";
var selectedPatientType = 1; var selectedPatientType = 1;
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************
@ -438,7 +434,7 @@ const TRANSACTION_NO = 0;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const STAMP = '2020-04-27T12:17:17.721Z'; const STAMP = '2020-04-27T12:17:17.721Z';
const IP_ADDRESS = '9.9.9.9'; const IP_ADDRESS = '9.9.9.9';
const VERSION_ID = 8.3; const VERSION_ID = 6.7;
const CHANNEL = 9; const CHANNEL = 9;
const SESSION_ID = 'BlUSkYymTt'; const SESSION_ID = 'BlUSkYymTt';
const IS_LOGIN_FOR_DOCTOR_APP = true; const IS_LOGIN_FOR_DOCTOR_APP = true;

@ -93,10 +93,6 @@ const Map<String, Map<String, String>> localizedValues = {
"en": "scan Qr code to retrieve patient profile", "en": "scan Qr code to retrieve patient profile",
"ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض" "ar": "مسح رمزاال QR لاسترداد ملف تعريف المريض"
}, },
"scanERQrCode": {
"en": "Scan Qr code to handle ER Sign In",
"ar": "امسح رمز ال ER للتعامل مع تسجيل الدخول"
},
"scanQr": {"en": "Scan Qr", "ar": "اقراء ال QR"}, "scanQr": {"en": "Scan Qr", "ar": "اقراء ال QR"},
"profile": {"en": "Profile", "ar": "ملفي الشخصي"}, "profile": {"en": "Profile", "ar": "ملفي الشخصي"},
"gender": {"en": "Gender", "ar": "الجنس"}, "gender": {"en": "Gender", "ar": "الجنس"},
@ -1133,7 +1129,7 @@ const Map<String, Map<String, String>> localizedValues = {
"VTE_Type": {"en": "VTE Type", "ar": "VTE Type"}, "VTE_Type": {"en": "VTE Type", "ar": "VTE Type"},
"pharmacology": {"en": "Pharmacology", "ar": "علم العقاقير"}, "pharmacology": {"en": "Pharmacology", "ar": "علم العقاقير"},
"reasonsThrombo": {"en": "Reasons Thrombo", "ar": "أسباب ثرومبو"}, "reasonsThrombo": {"en": "Reasons Thrombo", "ar": "أسباب ثرومبو"},
"youDoNotHaveFavoriteTemplate": {"en": "You Don't Have Favorite Template", "ar": "ليس لديك وصفة طبية مفضلة"}, "youDoNotHaveFavoritePrescription": {"en": "You Don't Have Favorite Prescription", "ar": "ليس لديك وصفة طبية مفضلة"},
"pleaseSelectItem": {"en": "please Select Item", "ar": "الرجاء اختيار عنصر"}, "pleaseSelectItem": {"en": "please Select Item", "ar": "الرجاء اختيار عنصر"},
"searchFavoriteTemplate": {"en": "search Favorites Template", "ar": "البحث في قالب المفضلة"}, "searchFavoriteTemplate": {"en": "search Favorites Template", "ar": "البحث في قالب المفضلة"},
"sorryNoMatch": {"en": "Sorry No Match", "ar": "عذرا لا يوجد تطابق"}, "sorryNoMatch": {"en": "Sorry No Match", "ar": "عذرا لا يوجد تطابق"},

@ -1,25 +0,0 @@
class DoctorErSignAssessmentReqModel {
String setupID;
int signInType;
int loginDoctorID;
int patientID;
DoctorErSignAssessmentReqModel(
{this.setupID, this.signInType, this.loginDoctorID, this.patientID});
DoctorErSignAssessmentReqModel.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
signInType = json['SignInType'];
loginDoctorID = json['LoginDoctorID'];
patientID = json['PatientID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['SignInType'] = this.signInType;
data['LoginDoctorID'] = this.loginDoctorID;
data['PatientID'] = this.patientID;
return data;
}
}

@ -32,8 +32,6 @@ class InsertIMEIDetailsModel {
String vidaAuthTokenID; String vidaAuthTokenID;
String vidaRefreshTokenID; String vidaRefreshTokenID;
dynamic password; dynamic password;
int loginDoctorID;
InsertIMEIDetailsModel( InsertIMEIDetailsModel(
{this.iMEI, {this.iMEI,
@ -68,7 +66,7 @@ class InsertIMEIDetailsModel {
this.patientOutSA, this.patientOutSA,
this.vidaAuthTokenID, this.vidaAuthTokenID,
this.vidaRefreshTokenID, this.vidaRefreshTokenID,
this.password, this.loginDoctorID}); this.password});
InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) { InsertIMEIDetailsModel.fromJson(Map<String, dynamic> json) {
iMEI = json['IMEI']; iMEI = json['IMEI'];
@ -104,7 +102,7 @@ class InsertIMEIDetailsModel {
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
vidaRefreshTokenID = json['VidaRefreshTokenID']; vidaRefreshTokenID = json['VidaRefreshTokenID'];
password = json['Password']; password = json['Password'];
loginDoctorID = json['LoginDoctorID']; } }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
@ -141,8 +139,6 @@ class InsertIMEIDetailsModel {
data['VidaAuthTokenID'] = this.vidaAuthTokenID; data['VidaAuthTokenID'] = this.vidaAuthTokenID;
data['VidaRefreshTokenID'] = this.vidaRefreshTokenID; data['VidaRefreshTokenID'] = this.vidaRefreshTokenID;
data['Password'] = this.password; data['Password'] = this.password;
data['LoginDoctorID'] = this.loginDoctorID;
return data; return data;
} }
} }

@ -14,8 +14,6 @@ class PatientSearchRequestModel {
String identificationNo; String identificationNo;
int nursingStationID; int nursingStationID;
int clinicID = 0; int clinicID = 0;
int loginDoctorID;
PatientSearchRequestModel( PatientSearchRequestModel(
{this.doctorID, {this.doctorID,
@ -32,7 +30,7 @@ class PatientSearchRequestModel {
this.to = "0", this.to = "0",
this.clinicID, this.clinicID,
this.nursingStationID = 0, this.nursingStationID = 0,
this.projectID, this.loginDoctorID}); this.projectID});
PatientSearchRequestModel.fromJson(Map<String, dynamic> json) { PatientSearchRequestModel.fromJson(Map<String, dynamic> json) {
doctorID = json['DoctorID']; doctorID = json['DoctorID'];
@ -50,7 +48,6 @@ class PatientSearchRequestModel {
nursingStationID = json['NursingStationID']; nursingStationID = json['NursingStationID'];
clinicID = json['ClinicID']; clinicID = json['ClinicID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
loginDoctorID = json['LoginDoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -70,7 +67,6 @@ class PatientSearchRequestModel {
data['NursingStationID'] = this.nursingStationID; data['NursingStationID'] = this.nursingStationID;
data['ClinicID'] = this.clinicID; data['ClinicID'] = this.clinicID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['LoginDoctorID'] = this.loginDoctorID;
return data; return data;
} }
} }

@ -1,18 +1,18 @@
class ProcedureValidationRequestModel { class ProcedureValadteRequestModel {
String vidaAuthTokenID; String vidaAuthTokenID;
int patientMRN; int patientMRN;
int appointmentNo; int appointmentNo;
int episodeID; int episodeID;
List<String> procedure; List<String> procedure;
ProcedureValidationRequestModel( ProcedureValadteRequestModel(
{this.vidaAuthTokenID, {this.vidaAuthTokenID,
this.patientMRN, this.patientMRN,
this.appointmentNo, this.appointmentNo,
this.episodeID, this.episodeID,
this.procedure}); this.procedure});
ProcedureValidationRequestModel.fromJson(Map<String, dynamic> json) { ProcedureValadteRequestModel.fromJson(Map<String, dynamic> json) {
vidaAuthTokenID = json['VidaAuthTokenID']; vidaAuthTokenID = json['VidaAuthTokenID'];
patientMRN = json['PatientMRN']; patientMRN = json['PatientMRN'];
appointmentNo = json['AppointmentNo']; appointmentNo = json['AppointmentNo'];

@ -142,6 +142,7 @@ class AuthenticationService extends BaseService {
Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel) async { Future insertDeviceImei(InsertIMEIDetailsModel insertIMEIDetailsModel) async {
hasError = false; hasError = false;
// insertIMEIDetailsModel.tokenID = "@dm!n";
_insertDeviceImeiRes = {}; _insertDeviceImeiRes = {};
try { try {
await baseAppClient.post(INSERT_DEVICE_IMEI, await baseAppClient.post(INSERT_DEVICE_IMEI,

@ -11,8 +11,8 @@ class ScanQrService extends BaseService {
PatientSearchRequestModel requestModel, bool isMyInpatient) async { PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
requestModel.loginDoctorID = doctorProfile.doctorID;
requestModel.doctorID = 0; requestModel.doctorID = 0;
await baseAppClient.post( await baseAppClient.post(
GET_PATIENT_IN_PATIENT_LIST, GET_PATIENT_IN_PATIENT_LIST,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {

@ -11,7 +11,7 @@ class PatientInPatientService extends BaseService {
PatientSearchRequestModel requestModel, bool isMyInpatient) async { PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false; hasError = false;
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
requestModel.loginDoctorID = doctorProfile.doctorID;
if (isMyInpatient) { if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID; requestModel.doctorID = doctorProfile.doctorID;
} else { } else {

@ -168,9 +168,8 @@ class PatientService extends BaseService {
Future getInPatient( Future getInPatient(
PatientSearchRequestModel requestModel, bool isMyInpatient) async { PatientSearchRequestModel requestModel, bool isMyInpatient) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
requestModel.loginDoctorID = doctorProfile.doctorID;
if (isMyInpatient) { if (isMyInpatient) {
requestModel.doctorID = doctorProfile.doctorID; requestModel.doctorID = doctorProfile.doctorID;
} else { } else {

@ -20,7 +20,7 @@ class OperationReportService extends BaseService {
{GetReservationsRequestModel getReservationsRequestModel, {GetReservationsRequestModel getReservationsRequestModel,
int patientId}) async { int patientId}) async {
getReservationsRequestModel = getReservationsRequestModel =
GetReservationsRequestModel(patientID: patientId); GetReservationsRequestModel(patientID: patientId, doctorID: "");
hasError = false; hasError = false;
await baseAppClient.post(GET_RESERVATIONS, await baseAppClient.post(GET_RESERVATIONS,

@ -1,49 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_request_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_in_patient.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescriptions_order.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_get_list_pharmacy_for_prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/request_prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/calculate_box_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/item_by_medicine_request_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_model.dart';
import 'package:doctor_app_flutter/core/model/search_drug/search_drug_request_model.dart';
import 'package:doctor_app_flutter/core/service/base/lookup-service.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/utils/date-utils.dart';
import 'package:flutter/cupertino.dart';
class ERSignInService extends LookupService {
Future signInERPatient({DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel}) async {
hasError = false;
await baseAppClient.post(DOCTOR_ER_SIGN_ASSESSMENT,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: doctorErSignAssessmentReqModel.toJson());
}
}

@ -33,6 +33,7 @@ class PatientMedicalReportService extends BaseService {
Future getMedicalReportTemplate() async { Future getMedicalReportTemplate() async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['TokenID'] = "@dm!n";
body['SetupID'] = "91877"; body['SetupID'] = "91877";
body['TemplateID'] = 43; body['TemplateID'] = 43;
@ -53,6 +54,7 @@ class PatientMedicalReportService extends BaseService {
Future insertMedicalReport(PatiantInformtion patient, String htmlText) async { Future insertMedicalReport(PatiantInformtion patient, String htmlText) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
// body['TokenID'] = "@dm!n";
body['SetupID'] = "91877"; body['SetupID'] = "91877";
body['AdmissionNo'] = patient.admissionNo; body['AdmissionNo'] = patient.admissionNo;
body['MedicalReportHTML'] = htmlText; body['MedicalReportHTML'] = htmlText;
@ -69,6 +71,7 @@ class PatientMedicalReportService extends BaseService {
PatiantInformtion patient, MedicalReportModel medicalReport) async { PatiantInformtion patient, MedicalReportModel medicalReport) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['TokenID'] = "@dm!n";
body['SetupID'] = "91877"; body['SetupID'] = "91877";
body['AdmissionNo'] = patient.admissionNo; body['AdmissionNo'] = patient.admissionNo;
body['InvoiceNo'] = medicalReport.invoiceNo; body['InvoiceNo'] = medicalReport.invoiceNo;
@ -89,6 +92,7 @@ class PatientMedicalReportService extends BaseService {
Future addMedicalReport(PatiantInformtion patient, String htmlText) async { Future addMedicalReport(PatiantInformtion patient, String htmlText) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
// body['TokenID'] = "@dm!n";
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
? body['SetupID'] ? body['SetupID']
@ -113,6 +117,7 @@ class PatientMedicalReportService extends BaseService {
int limitNumber, String invoiceNumber) async { int limitNumber, String invoiceNumber) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
// body['TokenID'] = "@dm!n";
body['LineItemNo'] = limitNumber; body['LineItemNo'] = limitNumber;
body['InvoiceNo'] = invoiceNumber; body['InvoiceNo'] = invoiceNumber;

@ -427,6 +427,7 @@ class PrescriptionService extends LookupService {
GetMedicationForInPatientRequestModel( GetMedicationForInPatientRequestModel(
isDentalAllowedBackend: false, isDentalAllowedBackend: false,
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient.admissionNo),
tokenID: "@dm!n",
projectID: patient.projectId, projectID: patient.projectId,
); );
await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT, await baseAppClient.postPatient(GET_MEDICATION_FOR_IN_PATIENT,

@ -183,8 +183,8 @@ class ProcedureService extends BaseService {
}, body: updateProcedureRequestModel.toJson()); }, body: updateProcedureRequestModel.toJson());
} }
Future validationProcedure( Future valadteProcedure(
ProcedureValidationRequestModel validationProcedureRequestModel) async { ProcedureValadteRequestModel procedureValadteRequestModel) async {
hasError = false; hasError = false;
_valadteProcedureList.clear(); _valadteProcedureList.clear();
await baseAppClient.post(GET_PROCEDURE_VALIDATION, await baseAppClient.post(GET_PROCEDURE_VALIDATION,
@ -194,6 +194,6 @@ class ProcedureService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: validationProcedureRequestModel.toJson()); }, body: procedureValadteRequestModel.toJson());
} }
} }

@ -1,41 +0,0 @@
import 'package:doctor_app_flutter/core/enum/filter_type.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/ER_sign_in/doctor_ER_sign_assessment_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/Prescriptions.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/get_medication_for_inpatient_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/perscription_pharmacy.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/post_prescrition_req_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_entity_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_model.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report.dart';
import 'package:doctor_app_flutter/core/model/Prescriptions/prescription_report_enh.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Allergy/get_allergies_res_model.dart';
import 'package:doctor_app_flutter/core/model/SOAP/Assessment/get_assessment_res_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/patient/vital_sign/patient-vital-sign-data.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/ER_signin/ER_signin_service.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/prescription/prescription_service.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:flutter/cupertino.dart';
class ERSignInViewModel extends BaseViewModel {
bool hasError = false;
ERSignInService _ERSignInService = locator<ERSignInService>();
Future signInERPatient({int patientId, int signInType}) async {
hasError = false;
await getDoctorProfile();
DoctorErSignAssessmentReqModel doctorErSignAssessmentReqModel = new DoctorErSignAssessmentReqModel(setupID:"010266", signInType:signInType, loginDoctorID:doctorProfile.doctorID, patientID: patientId );
setState(ViewState.BusyLocal);
await _ERSignInService.signInERPatient(doctorErSignAssessmentReqModel: doctorErSignAssessmentReqModel);
if (_ERSignInService.hasError) {
error = _ERSignInService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -70,7 +70,6 @@ class PatientSearchViewModel extends BaseViewModel {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
await getDoctorProfile(isGetProfile: true); await getDoctorProfile(isGetProfile: true);
patientSearchRequestModel.loginDoctorID = doctorProfile.doctorID;
patientSearchRequestModel.doctorID = doctorProfile.doctorID; patientSearchRequestModel.doctorID = doctorProfile.doctorID;
await _outPatientService.getOutPatient(patientSearchRequestModel); await _outPatientService.getOutPatient(patientSearchRequestModel);
if (_outPatientService.hasError) { if (_outPatientService.hasError) {

@ -112,8 +112,6 @@ class AuthenticationViewModel extends BaseViewModel {
insertIMEIDetailsModel.vidaRefreshTokenID = insertIMEIDetailsModel.vidaRefreshTokenID =
await sharedPref.getString(VIDA_REFRESH_TOKEN_ID); await sharedPref.getString(VIDA_REFRESH_TOKEN_ID);
insertIMEIDetailsModel.password = userInfo.password; insertIMEIDetailsModel.password = userInfo.password;
insertIMEIDetailsModel.loginDoctorID = loggedUser != null ? loggedUser.listMemberInformation[0].employeeID
: int.parse(user.editedBy.toString());
await _authService.insertDeviceImei(insertIMEIDetailsModel); await _authService.insertDeviceImei(insertIMEIDetailsModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -156,8 +154,6 @@ class AuthenticationViewModel extends BaseViewModel {
isMobileFingerPrint: 1, isMobileFingerPrint: 1,
vidaAuthTokenID: user.vidaAuthTokenID, vidaAuthTokenID: user.vidaAuthTokenID,
vidaRefreshTokenID: user.vidaRefreshTokenID); vidaRefreshTokenID: user.vidaRefreshTokenID);
await sharedPref.setString(DOCTOR_ID, user.editedBy.toString());
await _authService await _authService
.sendActivationCodeVerificationScreen(activationCodeModel); .sendActivationCodeVerificationScreen(activationCodeModel);
if (_authService.hasError) { if (_authService.hasError) {
@ -178,7 +174,6 @@ class AuthenticationViewModel extends BaseViewModel {
loginDoctorID: loggedUser.listMemberInformation[0].employeeID, loginDoctorID: loggedUser.listMemberInformation[0].employeeID,
otpSendType: authMethodType.getTypeIdService().toString(), otpSendType: authMethodType.getTypeIdService().toString(),
); );
await sharedPref.setString(DOCTOR_ID, (loggedUser.listMemberInformation[0].employeeID).toString());
await _authService.sendActivationCodeForDoctorApp(activationCodeModel); await _authService.sendActivationCodeForDoctorApp(activationCodeModel);
if (_authService.hasError) { if (_authService.hasError) {
error = _authService.error; error = _authService.error;
@ -194,7 +189,6 @@ class AuthenticationViewModel extends BaseViewModel {
Future checkActivationCodeForDoctorApp( Future checkActivationCodeForDoctorApp(
{String activationCode, bool isSilentLogin = false}) async { {String activationCode, bool isSilentLogin = false}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
CheckActivationCodeRequestModel checkActivationCodeForDoctorApp = CheckActivationCodeRequestModel checkActivationCodeForDoctorApp =
new CheckActivationCodeRequestModel( new CheckActivationCodeRequestModel(
zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode, zipCode: loggedUser != null ? loggedUser.zipCode : user.zipCode,
@ -214,8 +208,9 @@ class AuthenticationViewModel extends BaseViewModel {
: user.projectID.toString(), : user.projectID.toString(),
oTPSendType: await sharedPref.getInt(OTP_TYPE), oTPSendType: await sharedPref.getInt(OTP_TYPE),
iMEI: localToken, iMEI: localToken,
loginDoctorID: loggedUser != null ? loggedUser.listMemberInformation[0].employeeID loginDoctorID: userInfo.userID != null
: int.parse(user.editedBy.toString()),///loggedUser.listMemberInformation[0].employeeID, ? int.parse(userInfo.userID)
: user.editedBy,
// loggedUser.listMemberInformation[0].employeeID, // loggedUser.listMemberInformation[0].employeeID,
isForSilentLogin: isSilentLogin, isForSilentLogin: isSilentLogin,
generalid: "Cs2020@2016\$2958"); generalid: "Cs2020@2016\$2958");

@ -59,7 +59,6 @@ class DashboardViewModel extends BaseViewModel {
_firebaseMessaging.getToken().then((String token) async { _firebaseMessaging.getToken().then((String token) async {
if (token != '') { if (token != '') {
// DEVICE_TOKEN = token; // DEVICE_TOKEN = token;
///TODO Elham* return it back
authProvider.insertDeviceImei(token); authProvider.insertDeviceImei(token);
} }
}); });

@ -1,4 +1,3 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/enum/filter_type.dart'; import 'package:doctor_app_flutter/core/enum/filter_type.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/labs/lab_order_result.dart'; import 'package:doctor_app_flutter/core/model/labs/lab_order_result.dart';
@ -7,8 +6,7 @@ import 'package:doctor_app_flutter/core/model/labs/patient_lab_orders.dart';
import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart'; import 'package:doctor_app_flutter/core/model/labs/patient_lab_special_result.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart' as cpe;
as cpe;
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/post_procedure_req_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_templateModel.dart';
@ -72,16 +70,9 @@ class ProcedureViewModel extends BaseViewModel {
List<ProcedureTempleteDetailsModel> get procedureTemplateDetails => List<ProcedureTempleteDetailsModel> get procedureTemplateDetails =>
_procedureService.templateDetailsList; _procedureService.templateDetailsList;
Future getProcedure( Future getProcedure({int mrn, String patientType, int appointmentNo}) async {
{int mrn,
String patientType,
int appointmentNo,
bool isLocalBusy = false}) async {
hasError = false; hasError = false;
await getDoctorProfile(); await getDoctorProfile();
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedure( await _procedureService.getProcedure(
mrn: mrn, appointmentNo: appointmentNo); mrn: mrn, appointmentNo: appointmentNo);
@ -96,15 +87,9 @@ class ProcedureViewModel extends BaseViewModel {
} }
Future getProcedureCategory( Future getProcedureCategory(
{String categoryName, {String categoryName, String categoryID, patientId}) async {
String categoryID,
patientId,
bool isLocalBusy = false}) async {
if (categoryName == null) return; if (categoryName == null) return;
hasError = false; hasError = false;
if (isLocalBusy)
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.getProcedureCategory( await _procedureService.getProcedureCategory(
categoryName: categoryName, categoryName: categoryName,
@ -129,17 +114,13 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future getProcedureTemplate( Future getProcedureTemplate({String categoryID, bool isLocalBusy = false, BuildContext context}) async {
{String categoryID,
bool isLocalBusy = false,
BuildContext context}) async {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
await _procedureService.getProcedureTemplate( await _procedureService.getProcedureTemplate(categoryID: categoryID, isLocalBusy: false);
categoryID: categoryID, isLocalBusy: false);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -185,33 +166,27 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
Future postProcedure(PostProcedureReqModel postProcedureReqModel, int mrn, Future postProcedure(
{bool isLocalBusy = false}) async { PostProcedureReqModel postProcedureReqModel, int mrn) async {
hasError = false; hasError = false;
if (isLocalBusy) //_insuranceCardService.clearInsuranceCard();
setState(ViewState.BusyLocal);
else
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.postProcedure(postProcedureReqModel); await _procedureService.postProcedure(postProcedureReqModel);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
} else { } else {
await getProcedure(mrn: mrn, isLocalBusy:isLocalBusy); await getProcedure(mrn: mrn);
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future validationProcedure( Future valadteProcedure(
ProcedureValidationRequestModel procedureValidateRequestModel, ProcedureValadteRequestModel procedureValadteRequestModel) async {
{bool isLocalBusy = false}) async {
hasError = false; hasError = false;
if (isLocalBusy) { //_insuranceCardService.clearInsuranceCard();
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy); setState(ViewState.Busy);
} await _procedureService.valadteProcedure(procedureValadteRequestModel);
await _procedureService.validationProcedure(procedureValidateRequestModel);
if (_procedureService.hasError) { if (_procedureService.hasError) {
error = _procedureService.error; error = _procedureService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -222,9 +197,9 @@ class ProcedureViewModel extends BaseViewModel {
Future updateProcedure( Future updateProcedure(
{UpdateProcedureRequestModel updateProcedureRequestModel, {UpdateProcedureRequestModel updateProcedureRequestModel,
int mrn, bool isLocalBusy = false}) async { int mrn}) async {
hasError = false; hasError = false;
if(isLocalBusy)setState(ViewState.BusyLocal); else //_insuranceCardService.clearInsuranceCard();
setState(ViewState.Busy); setState(ViewState.Busy);
await _procedureService.updateProcedure(updateProcedureRequestModel); await _procedureService.updateProcedure(updateProcedureRequestModel);
if (_procedureService.hasError) { if (_procedureService.hasError) {
@ -390,14 +365,15 @@ class ProcedureViewModel extends BaseViewModel {
DrAppToastMsg.showSuccesToast(mes); DrAppToastMsg.showSuccesToast(mes);
} }
Future preparePostProcedure({ Future preparePostProcedure(
String remarks, {String remarks,
String orderType, String orderType,
PatiantInformtion patient, PatiantInformtion patient,
List<cpe.EntityList> entityList, List<cpe.EntityList> entityList,
ProcedureType procedureType, ProcedureType procedureType,
bool isLocalBusy = false, bool isLocalBusy = false,
}) async { }) async {
///TODO Roaa Move it to function ///TODO Roaa Move it to function
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
@ -405,8 +381,8 @@ class ProcedureViewModel extends BaseViewModel {
setState(ViewState.Busy); setState(ViewState.Busy);
} }
PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel(); PostProcedureReqModel postProcedureReqModel = new PostProcedureReqModel();
ProcedureValidationRequestModel procedureValadteRequestModel = ProcedureValadteRequestModel procedureValadteRequestModel =
new ProcedureValidationRequestModel(); new ProcedureValadteRequestModel();
procedureValadteRequestModel.patientMRN = patient.patientMRN; procedureValadteRequestModel.patientMRN = patient.patientMRN;
procedureValadteRequestModel.episodeID = patient.episodeNo; procedureValadteRequestModel.episodeID = patient.episodeNo;
procedureValadteRequestModel.appointmentNo = patient.appointmentNo; procedureValadteRequestModel.appointmentNo = patient.appointmentNo;
@ -439,22 +415,16 @@ class ProcedureViewModel extends BaseViewModel {
}); });
postProcedureReqModel.procedures = controlsProcedure; postProcedureReqModel.procedures = controlsProcedure;
await validationProcedure(procedureValadteRequestModel, await valadteProcedure(procedureValadteRequestModel);
isLocalBusy: isLocalBusy);
if (state == ViewState.Idle) { if (state == ViewState.Idle) {
if (valadteProcedureList[0].entityList.length == 0) { if (valadteProcedureList[0].entityList.length == 0) {
await postProcedure(postProcedureReqModel, patient.patientMRN, await postProcedure(postProcedureReqModel, patient.patientMRN);
isLocalBusy: isLocalBusy);
if (state == ViewState.ErrorLocal) { if (state == ViewState.ErrorLocal) {
Utils.showErrorToast(error); Utils.showErrorToast(error);
getProcedure(mrn: patient.patientMRN, isLocalBusy: isLocalBusy); getProcedure(mrn: patient.patientMRN);
} else if (state == ViewState.Idle) { } else if (state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been added'); DrAppToastMsg.showSuccesToast('procedure has been added');
if (Navigator.canPop(AppGlobal.CONTEX))
Navigator.pop(AppGlobal.CONTEX);
if (Navigator.canPop(AppGlobal.CONTEX))
Navigator.pop(AppGlobal.CONTEX);
} }
} else { } else {
if (state == ViewState.ErrorLocal) { if (state == ViewState.ErrorLocal) {
@ -470,18 +440,15 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
bool isEntityListSelected( bool isEntityListSelected(cpe.EntityList masterKey, List<cpe.EntityList> entityList) {
cpe.EntityList masterKey, List<cpe.EntityList> entityList) { Iterable<cpe.EntityList> history = entityList.where((element) => masterKey.procedureId == element.procedureId);
Iterable<cpe.EntityList> history = entityList
.where((element) => masterKey.procedureId == element.procedureId);
if (history.length > 0) { if (history.length > 0) {
return true; return true;
} }
return false; return false;
} }
bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey, bool isProcedureEntityListSelected(ProcedureTempleteDetailsModel masterKey, List<ProcedureTempleteDetailsModel> entityList) {
List<ProcedureTempleteDetailsModel> entityList) {
Iterable<ProcedureTempleteDetailsModel> history = entityList.where( Iterable<ProcedureTempleteDetailsModel> history = entityList.where(
(element) => (element) =>
masterKey.templateID == element.templateID && masterKey.templateID == element.templateID &&
@ -492,12 +459,13 @@ class ProcedureViewModel extends BaseViewModel {
return false; return false;
} }
Future addProcedures(
ProcedureViewModel model,
Future addProcedures(ProcedureViewModel model,
List<ProcedureTempleteDetailsModel> items, List<ProcedureTempleteDetailsModel> items,
PatiantInformtion patient, PatiantInformtion patient,
TextEditingController remarksController, TextEditingController remarksController,
{bool isLocalBusy = false}) async { {bool isLocalBusy = false,}) async {
if (isLocalBusy) { if (isLocalBusy) {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
} else { } else {
@ -521,12 +489,11 @@ class ProcedureViewModel extends BaseViewModel {
await model.preparePostProcedure( await model.preparePostProcedure(
entityList: entityList, entityList: entityList,
patient: patient, patient: patient,
remarks: remarksController.text, remarks: remarksController.text);
isLocalBusy: isLocalBusy);
} }
Future filterSearchResults(String query, List<cpe.EntityList> masterList, Future filterSearchResults(String query,List<cpe.EntityList> masterList, List<cpe.EntityList> items) async {
List<cpe.EntityList> items) async {
List<cpe.EntityList> dummySearchList = List(); List<cpe.EntityList> dummySearchList = List();
dummySearchList.addAll(masterList); dummySearchList.addAll(masterList);
if (query.isNotEmpty) { if (query.isNotEmpty) {
@ -544,12 +511,8 @@ class ProcedureViewModel extends BaseViewModel {
} }
} }
void filterProcedureSearchResults( void filterProcedureSearchResults(String query, List<ProcedureTempleteModel> masterList, List<ProcedureTempleteModel> items) {
String query,
List<ProcedureTempleteModel> masterList,
List<ProcedureTempleteModel> items) {
List<ProcedureTempleteModel> dummySearchList = List(); List<ProcedureTempleteModel> dummySearchList = List();
if(masterList!= null)
dummySearchList.addAll(masterList); dummySearchList.addAll(masterList);
if (query.isNotEmpty) { if (query.isNotEmpty) {
List<ProcedureTempleteModel> dummyListData = List(); List<ProcedureTempleteModel> dummyListData = List();

@ -1,7 +1,6 @@
import 'package:doctor_app_flutter/core/service/authentication_service.dart'; import 'package:doctor_app_flutter/core/service/authentication_service.dart';
import 'package:doctor_app_flutter/core/service/home/scan_qr_service.dart'; import 'package:doctor_app_flutter/core/service/home/scan_qr_service.dart';
import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart'; import 'package:doctor_app_flutter/core/service/patient/profile/discharge_summary_servive.dart';
import 'package:doctor_app_flutter/core/service/patient_medical_file/ER_signin/ER_signin_service.dart';
import 'package:doctor_app_flutter/core/service/pending_order_service.dart'; import 'package:doctor_app_flutter/core/service/pending_order_service.dart';
import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/dashboard_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/hospitals_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/hospitals_view_model.dart';
@ -51,7 +50,6 @@ import 'core/service/patient_medical_file/ucaf/patient-ucaf-service.dart';
import 'core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart'; import 'core/service/patient_medical_file/vital_sign/patient-vital-signs-service.dart';
import 'core/service/special_clinics/special_clinic_service.dart'; import 'core/service/special_clinics/special_clinic_service.dart';
import 'core/viewModel/DischargedPatientViewModel.dart'; import 'core/viewModel/DischargedPatientViewModel.dart';
import 'core/viewModel/ER_sign_in/ER_sign_in_view_model.dart';
import 'core/viewModel/InsuranceViewModel.dart'; import 'core/viewModel/InsuranceViewModel.dart';
import 'core/viewModel/LiveCarePatientViewModel.dart'; import 'core/viewModel/LiveCarePatientViewModel.dart';
import 'core/viewModel/PatientMedicalReportViewModel.dart'; import 'core/viewModel/PatientMedicalReportViewModel.dart';
@ -116,8 +114,6 @@ void setupLocator() {
locator.registerLazySingleton(() => DischargeSummaryService()); locator.registerLazySingleton(() => DischargeSummaryService());
locator.registerLazySingleton(() => VteAssessmentService()); locator.registerLazySingleton(() => VteAssessmentService());
locator.registerLazySingleton(() => InterventionMedicationService()); locator.registerLazySingleton(() => InterventionMedicationService());
locator.registerLazySingleton(() => ERSignInService());
/// View Model /// View Model
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());
@ -151,5 +147,4 @@ void setupLocator() {
locator.registerFactory(() => DischargeSummaryViewModel()); locator.registerFactory(() => DischargeSummaryViewModel());
locator.registerFactory(() => VteAssessmentViewModel()); locator.registerFactory(() => VteAssessmentViewModel());
locator.registerFactory(() => InterventionMedicationViewModel()); locator.registerFactory(() => InterventionMedicationViewModel());
locator.registerFactory(() => ERSignInViewModel());
} }

@ -1,227 +0,0 @@
import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/ER_sign_in/ER_sign_in_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart';
import 'package:doctor_app_flutter/locator.dart';
import 'package:doctor_app_flutter/screens/patients/patient_search/patient_search_header.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.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/widgets/shared/app_scaffold_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/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../routes.dart';
import '../base/base_view.dart';
Utils helpers = Utils();
class ErSignInScreen extends StatefulWidget {
@override
_ErSignInScreenState createState() => _ErSignInScreenState();
}
class _ErSignInScreenState extends State<ErSignInScreen> {
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<ERSignInViewModel>(
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
isShowAppBar: true,
appBar: PatientSearchHeader(title: "ER Sign In",)
,
body: Center(
child: Container(
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
child: FractionallySizedBox(
widthFactor: 0.9,
child: ListView(
children: [
AppText(
TranslationBase.of(context).startScanning,
fontSize: 18,
fontWeight: FontWeight.bold,
textAlign: TextAlign.center,
),
SizedBox(
height: 7,
),
AppText(TranslationBase.of(context).scanERQrCode,
fontSize: 14,
fontWeight: FontWeight.w400,
textAlign: TextAlign.center),
SizedBox(
height: 15,
),
Container(
height: 150,
child: Image.asset('assets/images/qr_code.png'),
),
SizedBox(
height: 35,
),
AppButton(
title: TranslationBase.of(context).scanQr,
onPressed: () async {
await locator<AnalyticsService>().logEvent(
eventCategory: "ErSigninScreen",
eventAction: "Scan QR",
);
_scanQrAndGetPatient(context, model);
},
icon: Image.asset('assets/images/qr_code_white.png'),
),
],
),
),
),
),
),
);
}
_scanQrAndGetPatient(BuildContext context, ERSignInViewModel model) async {
var result = (await BarcodeScanner.scan()).rawContent;
if (result != "") {
try{
List<String> listOfParams = result.split(',');
int patientID = 0;
if (listOfParams[0].length != 0)
patientID = int.parse(listOfParams[0]);
showMyDialog(context:context, firstAction: (){
signInERPatient(context: context, model: model, patientId: patientID, signInType: 1);
} , secondAction: (){
signInERPatient(context: context, model: model, patientId: patientID, signInType: 2);
} );
}catch(e){
Utils.showErrorToast("Please Enter Valid Code");
}
}
}
signInERPatient ({BuildContext context, ERSignInViewModel model, patientId, signInType}) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.signInERPatient(patientId:patientId, signInType: signInType );
if(model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error);
} else {
/// TODO Elham* Create this in Utils
DrAppToastMsg.showSuccesToast("Add successfully");
}
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop();
}
/// TODO Elham* Make this as custom Dialog
showMyDialog({BuildContext context, Function firstAction,Function secondAction, }) {
showDialog(
context: context,
builder: (ctx) => Center(
child: Container(
width: MediaQuery.of(context).size.width * 0.8,
height: 250,
child: AppScaffold(
isShowAppBar: false,
body: Container(
color: Colors.white,
child: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
// SizedBox(height: 20,),
SizedBox(
height: 10,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
AppText(
"Select option",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
),
],
),
SizedBox(
height: 10,
),
DividerWithSpacesAround(),
SizedBox(
height: 12,
),
Container(
padding: EdgeInsets.all(20),
color: Colors.white,
child: AppText(
projectViewModel.isArabic
? "الرجاء اختيار الإجراء الذي تريد القيام به"
: 'Please choose the action you want to do ',
fontSize: 15,
textAlign: TextAlign.center,
),
),
SizedBox(
height: 8,
),
DividerWithSpacesAround(),
FractionallySizedBox(
widthFactor: 0.75,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
FlatButton(
child: AppText(
"Sing In",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Cancel"),
onPressed: () async {
await firstAction();
}),
FlatButton(
child: AppText(
"Sing Out",
fontWeight: FontWeight.w600,
color: Colors.black,
fontSize: 16,
), //Text("Confirm", ),
onPressed: () async {
await secondAction();
})
],
),
)
],
),
),
),
),
),
));
}
}

@ -7,7 +7,6 @@ import 'package:doctor_app_flutter/core/viewModel/dashboard_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/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/screens/ER_singin/ER_singin_screen.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/home/dashboard_slider-item-widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_slider-item-widget.dart';
import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart'; import 'package:doctor_app_flutter/screens/home/dashboard_swipe_widget.dart';
@ -406,24 +405,6 @@ class _HomeScreenState extends State<HomeScreen> {
changeColorIndex(); changeColorIndex();
} }
patientCards.add(HomePatientCard(
gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex],
cardIcon: DoctorApp.qr_reader,
textColor: textColors[colorIndex],
text: "ER sign In" ,
onTap: () {
Navigator.push(
context,
FadePage(
page: ErSignInScreen(
),
),
);
},
));
changeColorIndex();
patientCards.add(HomePatientCard( patientCards.add(HomePatientCard(
gradient: backgroundColors[colorIndex], gradient: backgroundColors[colorIndex],
backgroundIconColor: backgroundIconColors[colorIndex], backgroundIconColor: backgroundIconColors[colorIndex],

@ -84,7 +84,7 @@ class _LabsHomePageState extends State<LabsHomePage> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => BaseAddProcedureTabPage( builder: (context) => BaseAddProcedureTabPage(
patient: patient, patient: patient,
previousProcedureViewModel: model, model: model,
procedureType: ProcedureType.LAB_RESULT, procedureType: ProcedureType.LAB_RESULT,
), ),
settings: RouteSettings(name: 'AddProcedureTabPage'), settings: RouteSettings(name: 'AddProcedureTabPage'),

@ -283,9 +283,6 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
.patientProgressNoteList[ .patientProgressNoteList[
index] index]
.lineItemNo, .lineItemNo,
conditionId: model
.patientProgressNoteList[
index].condition,
createdBy: model createdBy: model
.patientProgressNoteList[ .patientProgressNoteList[
index] index]
@ -367,9 +364,6 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
admissionNo: int admissionNo: int
.parse(patient .parse(patient
.admissionNo), .admissionNo),
conditionId: model
.patientProgressNoteList[
index].condition,
cancelledNote: true, cancelledNote: true,
lineItemNo: model lineItemNo: model
.patientProgressNoteList[ .patientProgressNoteList[
@ -592,8 +586,6 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
); );
} }
/// TODO Elham* Make this as custom Dialog
showMyDialog({BuildContext context, Function confirmFun, String actionName}) { showMyDialog({BuildContext context, Function confirmFun, String actionName}) {
showDialog( showDialog(
context: context, context: context,

@ -197,8 +197,8 @@ class _UpdateNoteOrderState extends State<UpdateNoteOrder> {
.progressNote, .progressNote,
//TranslationBase.of(context).addProgressNote, //TranslationBase.of(context).addProgressNote,
controller: progressNoteController, controller: progressNoteController,
maxLines: 40, maxLines: 35,
minLines: 20, minLines: 25,
hasBorder: true, hasBorder: true,
// isTextFieldHasSuffix: true, // isTextFieldHasSuffix: true,

@ -88,7 +88,7 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
SlideUpPageRoute( SlideUpPageRoute(
widget: BaseAddProcedureTabPage( widget: BaseAddProcedureTabPage(
patient: patient, patient: patient,
previousProcedureViewModel: model, model: model,
procedureType: ProcedureType.RADIOLOGY, procedureType: ProcedureType.RADIOLOGY,
), ),
settingRoute: 'AddProcedureTabPage'), settingRoute: 'AddProcedureTabPage'),
@ -96,7 +96,6 @@ class _RadiologyHomePageState extends State<RadiologyHomePage> {
}, },
label: TranslationBase.of(context).applyForRadiologyOrder, label: TranslationBase.of(context).applyForRadiologyOrder,
), ),
///TODO Elham * fix this to be list view builder
...List.generate( ...List.generate(
model.radiologyList.length, model.radiologyList.length,
(index) => Container( (index) => Container(

@ -293,7 +293,8 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
model.medicationControllerError = ''; model.medicationControllerError = '';
model.illnessControllerError = ''; model.illnessControllerError = '';
if (complaintsController.text.isNotEmpty && if (complaintsController.text.isNotEmpty &&
illnessController.text.isNotEmpty) { illnessController.text.isNotEmpty &&
complaintsController.text.length > 25) {
await model.postSubjectServices( await model.postSubjectServices(
patientInfo: widget.patientInfo, patientInfo: widget.patientInfo,
complaintsText: complaintsController.text, complaintsText: complaintsController.text,
@ -311,6 +312,9 @@ class _UpdateSubjectivePageState extends State<UpdateSubjectivePage>
if (complaintsController.text.isEmpty) { if (complaintsController.text.isEmpty) {
model.complaintsControllerError = model.complaintsControllerError =
TranslationBase.of(context).emptyMessage; TranslationBase.of(context).emptyMessage;
} else if (complaintsController.text.length < 25) {
model.complaintsControllerError =
TranslationBase.of(context).chiefComplaintLength;
} }
if (illnessController.text.isEmpty) { if (illnessController.text.isEmpty) {

@ -46,7 +46,6 @@ class PrescriptionItemsPage extends StatelessWidget {
), ),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * .9,
child: Column( child: Column(
children: [ children: [
ListView.builder( ListView.builder(

@ -1,19 +1,19 @@
import 'package:doctor_app_flutter/core/enum/view_state.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_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/procedure_type.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.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/bottom_sheet/custom_bottom_sheet_container.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/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../config/config.dart';
import 'entity_list_checkbox_search_widget.dart'; import 'entity_list_checkbox_search_widget.dart';
class AddProcedurePage extends StatefulWidget { class AddProcedurePage extends StatefulWidget {
@ -65,9 +65,6 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
AppScaffold( AppScaffold(
isShowAppBar: false, isShowAppBar: false,
body: SingleChildScrollView( body: SingleChildScrollView(
child: FractionallySizedBox(
widthFactor: .97,
child: Center(
child: Column( child: Column(
children: [ children: [
Container( Container(
@ -121,28 +118,18 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
), ),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () async { onTap: () {
if (procedureName.text.isNotEmpty && if (procedureName.text.isNotEmpty &&
procedureName.text.length >= 3) { procedureName.text.length >= 3)
GifLoaderDialogUtils.showMyDialog( model.getProcedureCategory(
context);
await model.getProcedureCategory(
patientId: patient.patientId, patientId: patient.patientId,
categoryName: procedureName.text, categoryName:
isLocalBusy: true); procedureName.text);
if (model.state == else
ViewState.ErrorLocal) {
DrAppToastMsg.showErrorToast(
model.error);
}
GifLoaderDialogUtils.hideDialog(
context);
} else {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
TranslationBase.of(context) TranslationBase.of(context)
.atLeastThreeCharacters, .atLeastThreeCharacters,
); );
}
}, },
child: Icon( child: Icon(
Icons.search, Icons.search,
@ -162,7 +149,8 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
baseViewModel: model, baseViewModel: model,
child: EntityListCheckboxSearchWidget( child: EntityListCheckboxSearchWidget(
model: widget.model, model: widget.model,
masterList: model.categoriesList[0].entityList, masterList:
model.categoriesList[0].entityList,
removeProcedure: (item) { removeProcedure: (item) {
setState(() { setState(() {
entityList.remove(item); entityList.remove(item);
@ -173,31 +161,27 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
entityList.add(history); entityList.add(history);
}); });
}, },
addSelectedHistories: () {}, addSelectedHistories: () {
isEntityListSelected: (master) => widget.model },
.isEntityListSelected(master, entityList), isEntityListSelected: (master) =>
widget.model.isEntityListSelected(master,entityList),
)), )),
SizedBox( SizedBox(height: 10,)
height: 10,
)
],
),
),
),
),
], ],
), ),
), ),
), ),
), ),
bottomSheet: model.state == ViewState.BusyLocal || entityList.isEmpty Container(
? Container( margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
height: 0, child: Wrap(
) alignment: WrapAlignment.center,
: CustomBottomSheetContainer( children: <Widget>[
label: procedureType.getAddButtonTitle(context), AppButton(
onTap: () async { title: procedureType.getAddButtonTitle(context),
{ fontWeight: FontWeight.w700,
color: AppGlobal.appGreenColor,
onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
if (entityList.isEmpty == true) { if (entityList.isEmpty == true) {
DrAppToastMsg.showErrorToast( DrAppToastMsg.showErrorToast(
@ -208,7 +192,7 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
return; return;
} }
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.model.preparePostProcedure( await this.model.preparePostProcedure(
orderType: selectedType.toString(), orderType: selectedType.toString(),
entityList: entityList, entityList: entityList,
patient: patient, patient: patient,
@ -216,9 +200,15 @@ class _AddProcedurePageState extends State<AddProcedurePage> {
procedureType: ProcedureType.PROCEDURE, procedureType: ProcedureType.PROCEDURE,
isLocalBusy: true, isLocalBusy: true,
); );
GifLoaderDialogUtils.hideDialog(context); Navigator.pop(context);
} },
}), ),
],
),
),
],
),
),
), ),
); );
} }

@ -1,26 +1,27 @@
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/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_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/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/screens/prescription/add_prescription/add_prescription.dart'; import 'package:doctor_app_flutter/screens/prescription/add_prescription/add_prescription.dart';
import 'package:doctor_app_flutter/screens/procedures/add_procedure_page.dart';
import 'package:doctor_app_flutter/screens/procedures/favorite_procedure/add_favourite_procedure.dart'; import 'package:doctor_app_flutter/screens/procedures/favorite_procedure/add_favourite_procedure.dart';
import 'package:doctor_app_flutter/screens/procedures/add_procedure_page.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart';
import 'package:doctor_app_flutter/screens/procedures/tab_widget.dart'; import 'package:doctor_app_flutter/screens/procedures/tab_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/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class BaseAddProcedureTabPage extends StatefulWidget { class BaseAddProcedureTabPage extends StatefulWidget {
final ProcedureViewModel previousProcedureViewModel; final ProcedureViewModel model;
final PrescriptionViewModel prescriptionModel; final PrescriptionViewModel prescriptionModel;
final PatiantInformtion patient; final PatiantInformtion patient;
final ProcedureType procedureType; final ProcedureType procedureType;
const BaseAddProcedureTabPage( const BaseAddProcedureTabPage(
{Key key, {Key key,
this.previousProcedureViewModel, this.model,
this.prescriptionModel, this.prescriptionModel,
this.patient, this.patient,
@required this.procedureType}) @required this.procedureType})
@ -28,15 +29,16 @@ class BaseAddProcedureTabPage extends StatefulWidget {
@override @override
_BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState( _BaseAddProcedureTabPageState createState() => _BaseAddProcedureTabPageState(
patient: patient, procedureType: procedureType); patient: patient, model: model, procedureType: procedureType);
} }
class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage> class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
final ProcedureViewModel model;
final PatiantInformtion patient; final PatiantInformtion patient;
final ProcedureType procedureType; final ProcedureType procedureType;
_BaseAddProcedureTabPageState({this.patient, this.procedureType}); _BaseAddProcedureTabPageState({this.patient, this.model, this.procedureType});
TabController _tabController; TabController _tabController;
int _activeTab = 0; int _activeTab = 0;
@ -66,25 +68,20 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) async { onModelReady: (model) async {
if (widget.previousProcedureViewModel == null) { await model.getProcedureTemplate(categoryID: widget.procedureType.getCategoryId());
await model.getProcedureTemplate(
categoryID: widget.procedureType.getCategoryId());
}
}, },
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
baseViewModel: model, baseViewModel: model,
isShowAppBar: true, isShowAppBar: true,
appBar: BottomSheetTitle( appBar: BottomSheetTitle(title: procedureType.getToolbarLabel(context),),
title: procedureType.getToolbarLabel(context),
),
body: NetworkBaseView( body: NetworkBaseView(
baseViewModel: model, baseViewModel: model,
child: Scaffold( child: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: PreferredSize( appBar: PreferredSize(
preferredSize: preferredSize: Size.fromHeight(
Size.fromHeight(MediaQuery.of(context).size.height * 0.070), MediaQuery.of(context).size.height * 0.070),
child: TabBar( child: TabBar(
isScrollable: false, isScrollable: false,
controller: _tabController, controller: _tabController,
@ -92,16 +89,24 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
indicatorWeight: 1.0, indicatorWeight: 1.0,
indicatorSize: TabBarIndicatorSize.tab, indicatorSize: TabBarIndicatorSize.tab,
labelColor: Theme.of(context).primaryColor, labelColor: Theme.of(context).primaryColor,
labelPadding: labelPadding: EdgeInsets.only(
EdgeInsets.only(top: 0, left: 0, right: 0, bottom: 0), top: 0, left: 0, right: 0, bottom: 0),
unselectedLabelColor: Colors.grey[800], unselectedLabelColor: Colors.grey[800],
tabs: [ tabs: [
TabWidget.tabWidget(screenSize, _activeTab == 0, TabWidget.tabWidget(
procedureType.getFavouriteTabName(context), screenSize,
isFirst: true, context: context), _activeTab == 0,
TabWidget.tabWidget(screenSize, _activeTab == 1,
procedureType
.getFavouriteTabName(context),
isFirst: true,context: context
),
TabWidget.tabWidget(
screenSize,
_activeTab == 1,
procedureType.getAllLabelName(context), procedureType.getAllLabelName(context),
isLast: true, context: context), isLast: true,context: context
),
], ],
), ),
), ),
@ -113,13 +118,14 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
controller: _tabController, controller: _tabController,
children: [ children: [
AddFavouriteProcedure( AddFavouriteProcedure(
previousProcedureViewModel: previousProcedureViewModel: model,
widget.previousProcedureViewModel ?? model, prescriptionModel:
prescriptionModel: widget.prescriptionModel, widget.prescriptionModel,
patient: patient, patient: patient,
procedureType: procedureType, procedureType: procedureType,
), ),
if (widget.procedureType == ProcedureType.PRESCRIPTION) if (widget.procedureType ==
ProcedureType.PRESCRIPTION)
AddPrescription( AddPrescription(
widget.prescriptionModel, widget.prescriptionModel,
widget.patient, widget.patient,
@ -127,7 +133,7 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
) )
else else
AddProcedurePage( AddProcedurePage(
model: widget.previousProcedureViewModel?? model, model: this.model,
patient: patient, patient: patient,
procedureType: procedureType, procedureType: procedureType,
), ),
@ -136,7 +142,8 @@ class _BaseAddProcedureTabPageState extends State<BaseAddProcedureTabPage>
), ),
], ],
), ),
)), )
),
), ),
); );
} }

@ -1,15 +1,13 @@
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_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:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.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/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart';
import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../config/config.dart'; import '../../config/config.dart';
class EntityListCheckboxSearchWidget extends StatefulWidget { class EntityListCheckboxSearchWidget extends StatefulWidget {
@ -20,15 +18,16 @@ class EntityListCheckboxSearchWidget extends StatefulWidget {
final bool Function(EntityList) isEntityListSelected; final bool Function(EntityList) isEntityListSelected;
final List<EntityList> masterList; final List<EntityList> masterList;
EntityListCheckboxSearchWidget({ EntityListCheckboxSearchWidget(
Key key, {Key key,
this.model, this.model,
this.addSelectedHistories, this.addSelectedHistories,
this.removeProcedure, this.removeProcedure,
this.masterList, this.masterList,
this.addProcedure, this.addProcedure,
this.isEntityListSelected, this.isEntityListSelected,
}) : super(key: key); })
: super(key: key);
@override @override
_EntityListCheckboxSearchWidgetState createState() => _EntityListCheckboxSearchWidgetState createState() =>
@ -81,8 +80,7 @@ class _EntityListCheckboxSearchWidgetState
suffixIcon: EvaIcons.search, suffixIcon: EvaIcons.search,
suffixIconColor: Color(0xff2B353E), suffixIconColor: Color(0xff2B353E),
onChanged: (value) { onChanged: (value) {
widget.model.filterSearchResults( widget.model.filterSearchResults(value, widget.masterList, items);
value, widget.masterList, items);
}, },
hasBorder: false, hasBorder: false,
), ),
@ -108,8 +106,8 @@ class _EntityListCheckboxSearchWidgetState
widget.removeProcedure( widget.removeProcedure(
historyInfo); historyInfo);
} else { } else {
widget.addProcedure( widget
historyInfo); .addProcedure(historyInfo);
} }
}); });
}), }),
@ -118,7 +116,7 @@ class _EntityListCheckboxSearchWidgetState
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0), horizontal: 10, vertical: 0),
child: AppText( child: AppText(
Utils.convertToTitleCase( historyInfo.procedureName), historyInfo.procedureName,
fontSize: 14.0, fontSize: 14.0,
variant: "bodyText", variant: "bodyText",
bold: true, bold: true,

@ -86,6 +86,7 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
color: AppGlobal.appTextColor, color: AppGlobal.appTextColor,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
), ),
), ),
], ],
@ -175,8 +176,7 @@ class _ExpansionProcedureState extends State<ExpansionProcedure> {
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 10, vertical: 0), horizontal: 10, vertical: 0),
child: AppText( child: AppText(
Utils.convertToTitleCase( Utils.convertToTitleCase(itemProcedure.procedureName),
itemProcedure.procedureName),
fontSize: 14.0, fontSize: 14.0,
variant: "bodyText", variant: "bodyText",
bold: true, bold: true,

@ -1,7 +1,7 @@
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_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/prescription/prescription_checkout_screen.dart'; import 'package:doctor_app_flutter/screens/prescription/prescription_checkout_screen.dart';
import 'package:doctor_app_flutter/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart'; import 'package:doctor_app_flutter/screens/procedures/favorite_procedure/entity_list_fav_procedure.dart';
@ -48,6 +48,7 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
Widget child) => Widget child) =>
AppScaffold( AppScaffold(
isShowAppBar: false, isShowAppBar: false,
baseViewModel: model,
body: Column(children: [ body: Column(children: [
(widget.previousProcedureViewModel.templateList.length != 0) (widget.previousProcedureViewModel.templateList.length != 0)
? Expanded( ? Expanded(
@ -66,8 +67,7 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
}); });
}, },
isEntityFavListSelected: (master) => isEntityFavListSelected: (master) =>
procedureViewModel.isProcedureEntityListSelected( procedureViewModel.isProcedureEntityListSelected(master, entityList),
master, entityList),
groupProcedures: groupProcedures, groupProcedures: groupProcedures,
selectProcedures: (selectedProcedure) { selectProcedures: (selectedProcedure) {
setState(() { setState(() {
@ -78,10 +78,10 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
) )
: ErrorMessage( : ErrorMessage(
error: TranslationBase.of(context) error: TranslationBase.of(context)
.youDoNotHaveFavoriteTemplate, .youDoNotHaveFavoritePrescription,
), ),
]), ]),
bottomSheet: widget.previousProcedureViewModel.templateList.length == 0?Container(height: 0,):CustomBottomSheetContainer( bottomSheet: CustomBottomSheetContainer(
label: widget.procedureType.getAddButtonTitle(context) ?? label: widget.procedureType.getAddButtonTitle(context) ??
TranslationBase.of(context).addSelectedProcedures, TranslationBase.of(context).addSelectedProcedures,
onTap: () async { onTap: () async {
@ -117,8 +117,7 @@ class _AddFavouriteProcedureState extends State<AddFavouriteProcedure> {
MaterialPageRoute( MaterialPageRoute(
builder: (context) => ProcedureCheckOutScreen( builder: (context) => ProcedureCheckOutScreen(
items: entityList, items: entityList,
previousProcedureViewModel: model: model,
widget.previousProcedureViewModel,
patient: widget.patient, patient: widget.patient,
addButtonTitle: widget.procedureType addButtonTitle: widget.procedureType
.getAddButtonTitle(context), .getAddButtonTitle(context),

@ -8,7 +8,6 @@ import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import '../../../config/config.dart'; import '../../../config/config.dart';
import '../../../widgets/shared/text_fields/app_text_field_custom_serach.dart'; import '../../../widgets/shared/text_fields/app_text_field_custom_serach.dart';
@ -77,6 +76,7 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
TextEditingController remarksController = TextEditingController(); TextEditingController remarksController = TextEditingController();
TextEditingController patientFileInfoController = TextEditingController(); TextEditingController patientFileInfoController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SingleChildScrollView( return SingleChildScrollView(
@ -88,18 +88,19 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
child: Container( child: Container(
margin: EdgeInsets.only(top: 15), margin: EdgeInsets.only(top: 15),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(8), color: Colors.white), borderRadius: BorderRadius.circular(8),
color: Colors.white),
child: ListView( child: ListView(
children: [ children: [
AppTextFieldCustomSearch( AppTextFieldCustomSearch(
searchController: patientFileInfoController, searchController: patientFileInfoController,
onChangeFun: (value) { onChangeFun: (value) {
widget.model.filterProcedureSearchResults( widget.model.filterProcedureSearchResults(value, widget.masterList, items);
value, widget.masterList, items);
}, },
marginTop: 5, marginTop: 5,
inputFormatters: [ inputFormatters: [
FilteringTextInputFormatter.allow(RegExp(ONLY_LETTERS)) FilteringTextInputFormatter.allow(
RegExp(ONLY_LETTERS))
], ],
inputType: TextInputType.text, inputType: TextInputType.text,
hintText: TranslationBase.of(context).searchFavoriteTemplate, hintText: TranslationBase.of(context).searchFavoriteTemplate,
@ -109,14 +110,16 @@ class _EntityListCheckboxSearchFavProceduresWidgetState
), ),
widget.model.templateList.length != 0 widget.model.templateList.length != 0
? Column( ? Column(
children: widget.model.templateList.map((historyInfo) { children:
widget.model.templateList.map((historyInfo) {
return ExpansionProcedure( return ExpansionProcedure(
procedureTempleteModel: historyInfo, procedureTempleteModel: historyInfo,
model: widget.model, model: widget.model,
removeFavProcedure: widget.removeFavProcedure, removeFavProcedure: widget.removeFavProcedure,
addFavProcedure: widget.addFavProcedure, addFavProcedure: widget.addFavProcedure,
selectProcedures: widget.selectProcedures, selectProcedures: widget.selectProcedures,
isEntityListSelected: widget.isEntityListSelected, isEntityListSelected:
widget.isEntityListSelected,
isEntityFavListSelected: isEntityFavListSelected:
widget.isEntityFavListSelected, widget.isEntityFavListSelected,
isProcedure: widget.isProcedure, isProcedure: widget.isProcedure,

@ -1,31 +1,28 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/procedure_template_details_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_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/patients/patient_search/patient_search_header.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/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.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:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import '../../../config/config.dart'; import '../../../config/config.dart';
class ProcedureCheckOutScreen extends StatefulWidget { class ProcedureCheckOutScreen extends StatefulWidget {
final List<ProcedureTempleteDetailsModel> items; final List<ProcedureTempleteDetailsModel> items;
final ProcedureViewModel previousProcedureViewModel; final ProcedureViewModel model;
final PatiantInformtion patient; final PatiantInformtion patient;
final String addButtonTitle; final String addButtonTitle;
final String toolbarTitle; final String toolbarTitle;
ProcedureCheckOutScreen( ProcedureCheckOutScreen(
{this.items, {this.items,
this.previousProcedureViewModel, this.model,
this.patient, this.patient,
@required this.addButtonTitle, @required this.addButtonTitle,
@required this.toolbarTitle}); @required this.toolbarTitle});
@ -46,28 +43,51 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
builder: (BuildContext context, ProcedureViewModel model, Widget child) => builder: (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( AppScaffold(
backgroundColor: Color(0xffF8F8F8).withOpacity(0.9), backgroundColor: Color(0xffF8F8F8).withOpacity(0.9),
isShowAppBar: true, isShowAppBar: false,
appBar: PatientSearchHeader(
title: widget.toolbarTitle ?? 'Add Procedure',
),
body: SingleChildScrollView( body: SingleChildScrollView(
child: Center(
child: FractionallySizedBox(
widthFactor: 0.95,
child: Column( child: Column(
children: [ children: [
Container(
height: MediaQuery.of(context).size.height * 0.070,
color: Colors.white,
),
Container(
color: Colors.white,
child: Padding(
padding: EdgeInsets.all(12.0),
child: Row(
//mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
child: Icon(
Icons.arrow_back_ios_sharp,
size: 24.0,
),
onTap: () {
Navigator.pop(context);
},
),
SizedBox(
width: 5.0,
),
AppText(
widget.toolbarTitle ?? 'Add Procedure',
fontWeight: FontWeight.w700,
fontSize: 20,
),
],
),
),
),
SizedBox( SizedBox(
height: 30, height: 30,
), ),
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: widget.items.length, itemCount: widget.items.length,
physics: BouncingScrollPhysics(),
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
final TextEditingController remarksControllerNew = final TextEditingController remarksControllerNew = TextEditingController(text: widget.items[index].remarks);
TextEditingController(
text: widget.items[index].remarks);
return Container( return Container(
margin: EdgeInsets.only(bottom: 15.0), margin: EdgeInsets.only(bottom: 15.0),
@ -79,13 +99,17 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
initiallyExpanded: true, initiallyExpanded: true,
title: Row( title: Row(
children: [ children: [
Icon(
Icons.check_box,
color: Color(0xffD02127),
size: 30.5,
),
SizedBox(
width: 6.0,
),
Expanded( Expanded(
child: AppText( child:
Utils.convertToTitleCase( AppText(widget.items[index].procedureName)),
widget.items[index].procedureName),
fontWeight: FontWeight.w700,
color: AppGlobal.appTextColor,
)),
], ],
), ),
children: [ children: [
@ -93,8 +117,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 12), padding: EdgeInsets.symmetric(horizontal: 12),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: [ children: [
Row( Row(
children: [ children: [
@ -102,8 +125,7 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
padding: const EdgeInsets.symmetric( padding: const EdgeInsets.symmetric(
horizontal: 11), horizontal: 11),
child: AppText( child: AppText(
TranslationBase.of(context) TranslationBase.of(context).orderType,
.orderType,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Color(0xff2B353E), color: Color(0xff2B353E),
), ),
@ -115,11 +137,10 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
Radio( Radio(
activeColor: Color(0xFFD02127), activeColor: Color(0xFFD02127),
value: 0, value: 0,
groupValue: widget groupValue:
.items[index].selectedType, widget.items[index].selectedType,
onChanged: (value) { onChanged: (value) {
widget.items[index].selectedType = widget.items[index].selectedType = 0;
0;
setState(() { setState(() {
widget.items[index].type = widget.items[index].type =
value.toString(); value.toString();
@ -133,12 +154,11 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
), ),
Radio( Radio(
activeColor: Color(0xFFD02127), activeColor: Color(0xFFD02127),
groupValue: widget groupValue:
.items[index].selectedType, widget.items[index].selectedType,
value: 1, value: 1,
onChanged: (value) { onChanged: (value) {
widget.items[index].selectedType = widget.items[index].selectedType = 1;
1;
setState(() { setState(() {
widget.items[index].type = widget.items[index].type =
value.toString(); value.toString();
@ -182,15 +202,13 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
), ),
); );
}), }),
SizedBox( SizedBox(
height: 90, height: 90,
), ),
], ],
), ),
), ),
),
),
///TODO Elham* use our custom bottomsheet
bottomSheet: Container( bottomSheet: Container(
margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5), margin: EdgeInsets.all(SizeConfig.widthMultiplier * 5),
child: Wrap( child: Wrap(
@ -203,12 +221,10 @@ class _ProcedureCheckOutScreenState extends State<ProcedureCheckOutScreen> {
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
onPressed: () async { onPressed: () async {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await widget.previousProcedureViewModel.addProcedures( await widget.model.addProcedures(model, widget.items, widget.patient, remarksController, isLocalBusy: true);
widget.previousProcedureViewModel,
widget.items, Navigator.pop(context);
widget.patient, Navigator.pop(context);
remarksController,
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}, },
), ),

@ -1,20 +1,18 @@
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/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/get_ordered_procedure_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/core/model/patient/patiant_info_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/utils.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/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/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
class ProcedureCard extends StatelessWidget { class ProcedureCard extends StatelessWidget {
final Function onTap; final Function onTap;
final EntityList entityList; final EntityList entityList;
@ -202,10 +200,9 @@ class ProcedureCard extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: AppText( child: AppText(
entityList.remarks != null entityList.remarks!= null?Utils.convertToTitleCase(
? Utils.convertToTitleCase( entityList.remarks.toString()) :
entityList.remarks.toString()) '',
: '',
fontSize: 12, fontSize: 12,
), ),
), ),

@ -1,22 +1,21 @@
import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.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/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_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/procedure_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/procedure_card.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_card.dart';
import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart'; import 'package:doctor_app_flutter/screens/procedures/procedure_type.dart';
import 'package:doctor_app_flutter/screens/procedures/update_procedure.dart'; import 'package:doctor_app_flutter/screens/procedures/update_procedure.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/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/add-order/addNewOrder.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart';
import 'package:doctor_app_flutter/widgets/patients/patient_service_title.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/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.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/material.dart'; import 'package:flutter/material.dart';
import '../../widgets/shared/errors/error_message.dart'; import '../../widgets/shared/errors/error_message.dart';
import 'base_add_procedure_tab_page.dart'; import 'base_add_procedure_tab_page.dart';
@ -58,9 +57,13 @@ class ProcedureScreen extends StatelessWidget {
SizedBox( SizedBox(
height: 12, height: 12,
), ),
if ((model.procedureList.length == 0 && if (model.procedureList.length == 0 &&
patient.patientStatusType != 43) || patient.patientStatusType != 43)
patient.patientStatusType != null && ServiceTitle(
title: TranslationBase.of(context).orderTestOr,
subTitle: TranslationBase.of(context).procedure,
),
if (patient.patientStatusType != null &&
patient.patientStatusType == 43) patient.patientStatusType == 43)
ServiceTitle( ServiceTitle(
title: TranslationBase.of(context).orderTestOr, title: TranslationBase.of(context).orderTestOr,
@ -70,32 +73,26 @@ class ProcedureScreen extends StatelessWidget {
patient.patientStatusType == 43) || patient.patientStatusType == 43) ||
(isFromLiveCare && patient.appointmentNo != null)) (isFromLiveCare && patient.appointmentNo != null))
AddNewOrder( AddNewOrder(
onTap: () async { onTap: () {
GifLoaderDialogUtils.showMyDialog(context);
await model.getProcedureTemplate(
categoryID: ProcedureType.PROCEDURE.getCategoryId(),
isLocalBusy: true);
GifLoaderDialogUtils.hideDialog(context);
Navigator.push( Navigator.push(
context, context,
SlideUpPageRoute( SlideUpPageRoute(
widget: BaseAddProcedureTabPage( widget: BaseAddProcedureTabPage(
patient: patient, patient: patient,
previousProcedureViewModel: model, model: model,
procedureType: ProcedureType.PROCEDURE, procedureType: ProcedureType.PROCEDURE,
), ),
settingRoute: 'AddProcedureTabPage'), settingRoute: 'AddProcedureTabPage'),
); );
}, },
label: TranslationBase.of(context).addMoreProcedure, label: TranslationBase.of(context)
.addMoreProcedure,
), ),
if (model.procedureList.isNotEmpty) if (model.procedureList.isNotEmpty)
ListView.builder( ListView.builder(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
itemCount: model.procedureList[0].rowcount, itemCount: model.procedureList[0].rowcount,
shrinkWrap: true, shrinkWrap: true,
physics: BouncingScrollPhysics(),
itemBuilder: (BuildContext ctxt, int index) { itemBuilder: (BuildContext ctxt, int index) {
return ProcedureCard( return ProcedureCard(
categoryID: model categoryID: model
@ -123,12 +120,12 @@ class ProcedureScreen extends StatelessWidget {
procedureId: model.procedureList[0] procedureId: model.procedureList[0]
.entityList[index].procedureId, .entityList[index].procedureId,
limetNo: model.procedureList[0] limetNo: model.procedureList[0]
.entityList[index].lineItemNo, .entityList[index].lineItemNo);
// } else
); // Helpers.showErrorToast(
// 'You Cant Update This Procedure');
}, },
patient: patient, patient: patient,
doctorID: model?.doctorProfile?.doctorID, doctorID: model?.doctorProfile?.doctorID,
); );
}), }),

@ -3,11 +3,13 @@ import 'package:doctor_app_flutter/utils/tab_utils.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
class TabWidget { class TabWidget {
static Widget tabWidget( static Widget tabWidget(
Size screenSize, Size screenSize,
bool isActive, bool isActive,
String title, { String title,
{
int counter = -1, int counter = -1,
bool isFirst = false, bool isFirst = false,
bool isMiddle = false, bool isMiddle = false,
@ -27,6 +29,7 @@ class TabWidget {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
TabUtils.getTabText(title: title, isActive: isActive), TabUtils.getTabText(title: title, isActive: isActive),
if (counter != -1) if (counter != -1)
TabUtils.getTabCounter(isActive: isActive, counter: counter) TabUtils.getTabCounter(isActive: isActive, counter: counter)

@ -1,20 +1,19 @@
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/core/enum/view_state.dart'; import 'package:doctor_app_flutter/core/enum/view_state.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart'; import 'package:doctor_app_flutter/core/model/procedure/ControlsModel.dart';
import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart'; import 'package:doctor_app_flutter/core/model/procedure/categories_procedure.dart';
import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart'; import 'package:doctor_app_flutter/core/model/procedure/update_procedure_request_model.dart';
import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart';
import 'package:doctor_app_flutter/core/model/patient/patiant_info_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/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.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/utils/utils.dart';
import 'package:doctor_app_flutter/widgets/bottom_sheet/custom_bottom_sheet_container.dart'; 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_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/text_fields/TextFields.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/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -38,19 +37,18 @@ void updateProcedureForm(context,
remarks: remarks, remarks: remarks,
remarksController: remarksController, remarksController: remarksController,
patient: patient, patient: patient,
previousModel: model, model: model,
procedureId: procedureId, procedureId: procedureId,
categoryId: categoreId, categoryId: categoreId,
orderNo: orderNo, orderNo: orderNo,
limetNo: limetNo, limetNo: limetNo,
selectedType: int.parse(orderType),
); );
}); });
} }
class UpdateProcedureWidget extends StatefulWidget { class UpdateProcedureWidget extends StatefulWidget {
final PatiantInformtion patient; final PatiantInformtion patient;
final ProcedureViewModel previousModel; final ProcedureViewModel model;
final String procedureName; final String procedureName;
final String remarks; final String remarks;
final TextEditingController remarksController; final TextEditingController remarksController;
@ -58,11 +56,9 @@ class UpdateProcedureWidget extends StatefulWidget {
final String categoryId; final String categoryId;
final int orderNo; final int orderNo;
final int limetNo; final int limetNo;
int selectedType;
UpdateProcedureWidget( UpdateProcedureWidget(
{this.previousModel, {this.model,
this.procedureName, this.procedureName,
this.remarks, this.remarks,
this.remarksController, this.remarksController,
@ -70,17 +66,18 @@ class UpdateProcedureWidget extends StatefulWidget {
this.procedureId, this.procedureId,
this.categoryId, this.categoryId,
this.orderNo, this.orderNo,
this.limetNo, this.selectedType}); this.limetNo});
@override @override
_UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState(); _UpdateProcedureWidgetState createState() => _UpdateProcedureWidgetState();
} }
class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> { class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
int selectedType = 0;
setSelectedType(int val) { setSelectedType(int val) {
setState(() { setState(() {
widget.selectedType = val; selectedType = val;
}); });
} }
@ -92,18 +89,18 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
List<EntityList> entityList = List(); List<EntityList> entityList = List();
dynamic selectedCategory; dynamic selectedCategory;
/// TODO Roaa Add translation and make sure it working fine
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final screenSize = MediaQuery.of(context).size;
return StatefulBuilder(builder:
(BuildContext context, StateSetter setState /*You can rename this!*/) {
return BaseView<ProcedureViewModel>( return BaseView<ProcedureViewModel>(
onModelReady: (model) => model.getCategory(), onModelReady: (model) => model.getCategory(),
builder: builder:
(BuildContext context, ProcedureViewModel _model, Widget child) => (BuildContext context, ProcedureViewModel model, Widget child) =>
AppScaffold( NetworkBaseView(
baseViewModel: widget.previousModel, baseViewModel: model,
isShowAppBar: true, child: SingleChildScrollView(
appBar: BottomSheetTitle(title: "Update Procedure"),
body: SingleChildScrollView(
child: Container( child: Container(
height: MediaQuery.of(context).size.height * 0.9, height: MediaQuery.of(context).size.height * 0.9,
child: Form( child: Form(
@ -114,7 +111,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
AppText( AppText(
Utils.convertToTitleCase(widget.procedureName), widget.procedureName.toUpperCase(),
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
), ),
SizedBox( SizedBox(
@ -127,7 +124,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
Radio( Radio(
activeColor: AppGlobal.appRedColor, activeColor: AppGlobal.appRedColor,
value: 0, value: 0,
groupValue: widget.selectedType, groupValue: selectedType,
onChanged: (value) { onChanged: (value) {
setSelectedType(value); setSelectedType(value);
}, },
@ -135,7 +132,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
Text('routine'), Text('routine'),
Radio( Radio(
activeColor: AppGlobal.appRedColor, activeColor: AppGlobal.appRedColor,
groupValue: widget.selectedType, groupValue: selectedType,
value: 1, value: 1,
onChanged: (value) { onChanged: (value) {
setSelectedType(value); setSelectedType(value);
@ -168,40 +165,66 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
SizedBox( SizedBox(
height: 70.0, height: 70.0,
), ),
], Container(
), margin:
), EdgeInsets.all(SizeConfig.widthMultiplier * 2),
)), child: Column(
), children: <Widget>[
bottomSheet: CustomBottomSheetContainer( AppButton(
label: TranslationBase.of(context).updateProcedure, color: AppGlobal.appGreenColor,
onTap: () => updateProcedure( title: TranslationBase.of(context)
lineItemNo: widget.limetNo, .updateProcedure
.toUpperCase(),
onPressed: () {
Navigator.pop(context);
updateProcedure(
limetNO: widget.limetNo,
orderNo: widget.orderNo, orderNo: widget.orderNo,
orderType: widget.selectedType.toString(), orderType: selectedType.toString(),
categoryId: widget.categoryId, categorieId: widget.categoryId,
procedureId: widget.procedureId, procedureId: widget.procedureId,
entityList: entityList, entityList: entityList,
patient: widget.patient, patient: widget.patient,
model: widget.previousModel, model: widget.model,
remarks: widget.remarksController.text), remarks: widget.remarksController.text);
// authorizationForm(context);
},
),
SizedBox(
height: 20.0,
),
AppButton(
title: TranslationBase.of(context).cancel,
color: AppGlobal.appRedColor,
onPressed: () {
Navigator.pop(context);
},
)
],
),
),
],
),
),
)),
), ),
), ),
); );
});
} }
updateProcedure( updateProcedure(
{ProcedureViewModel model, {ProcedureViewModel model,
String remarks, String remarks,
int lineItemNo, int limetNO,
int orderNo, int orderNo,
String newProcedureId, String newProcedureId,
String newCategoryId, String newCategorieId,
List<EntityList> entityList, List<EntityList> entityList,
String orderType, String orderType,
String procedureId, String procedureId,
PatiantInformtion patient, PatiantInformtion patient,
String categoryId}) async { String categorieId}) async {
UpdateProcedureRequestModel updateProcedureReqModel = UpdateProcedureRequestModel updateProcedureReqModel =
new UpdateProcedureRequestModel(); new UpdateProcedureRequestModel();
List<Controls> controls = List(); List<Controls> controls = List();
@ -211,7 +234,7 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
updateProcedureReqModel.episodeID = patient.episodeNo; updateProcedureReqModel.episodeID = patient.episodeNo;
updateProcedureReqModel.patientMRN = patient.patientMRN; updateProcedureReqModel.patientMRN = patient.patientMRN;
updateProcedureReqModel.lineItemNo = lineItemNo; updateProcedureReqModel.lineItemNo = limetNO;
updateProcedureReqModel.orderNo = orderNo; updateProcedureReqModel.orderNo = orderNo;
{ {
@ -224,24 +247,22 @@ class _UpdateProcedureWidgetState extends State<UpdateProcedureWidget> {
); );
controlsProcedure.procedure = procedureId; controlsProcedure.procedure = procedureId;
controlsProcedure.category = '0' + categoryId; controlsProcedure.category = '0' + categorieId;
controlsProcedure.controls = controls; controlsProcedure.controls = controls;
} }
updateProcedureReqModel.procedureDetail = controlsProcedure; updateProcedureReqModel.procedureDetail = controlsProcedure;
GifLoaderDialogUtils.showMyDialog(context);
await widget.previousModel.updateProcedure( await model.updateProcedure(
updateProcedureRequestModel: updateProcedureReqModel, updateProcedureRequestModel: updateProcedureReqModel,
mrn: patient.patientMRN, isLocalBusy: true); mrn: patient.patientMRN);
if (model.state == ViewState.ErrorLocal) { if (model.state == ViewState.ErrorLocal) {
Utils.showErrorToast(model.error); Utils.showErrorToast(model.error);
model.getProcedure(mrn: patient.patientMRN);
} else if (model.state == ViewState.Idle) { } else if (model.state == ViewState.Idle) {
DrAppToastMsg.showSuccesToast('procedure has been updated'); DrAppToastMsg.showSuccesToast('procedure has been updated');
await widget.previousModel.getProcedure(mrn: patient.patientMRN, isLocalBusy: true); model.getProcedure(mrn: patient.patientMRN);
Navigator.of(context).pop();
} }
GifLoaderDialogUtils.hideDialog(context);
} }
} }

@ -1,8 +1,6 @@
import 'package:barcode_scan2/barcode_scan2.dart'; import 'package:barcode_scan2/barcode_scan2.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.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/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_muse/PatientSearchRequestModel.dart'; import 'package:doctor_app_flutter/core/model/patient_muse/PatientSearchRequestModel.dart';
import 'package:doctor_app_flutter/core/service/AnalyticsService.dart'; import 'package:doctor_app_flutter/core/service/AnalyticsService.dart';
import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/scan_qr_view_model.dart';
@ -88,7 +86,6 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
_scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async { _scanQrAndGetPatient(BuildContext context, ScanQrViewModel model) async {
var result = (await BarcodeScanner.scan()).rawContent; var result = (await BarcodeScanner.scan()).rawContent;
if (result != "") { if (result != "") {
DoctorProfileModel doctorProfile =await getDoctorProfile(isGetProfile: true);
List<String> listOfParams = result.split(','); List<String> listOfParams = result.split(',');
int patientID = 0; int patientID = 0;
if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]); if (listOfParams[1].length != 0) patientID = int.parse(listOfParams[1]);
@ -99,8 +96,6 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
doctorID: 0, doctorID: 0,
projectID: int.parse(listOfParams[0])); projectID: int.parse(listOfParams[0]));
patientSearchRequestModel.loginDoctorID = doctorProfile.doctorID;
await model await model
.getInPatientList(patientSearchRequestModel, isMyInpatient: false) .getInPatientList(patientSearchRequestModel, isMyInpatient: false)
.then((d) { .then((d) {
@ -120,31 +115,4 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
}); });
} }
} }
Future<DoctorProfileModel> getDoctorProfile(
{bool isGetProfile = false}) async {
DoctorProfileModel doctorProfile;
if (isGetProfile) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) {
return doctorProfile;
}
}
}
if (doctorProfile == null) {
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
if (profile != null) {
doctorProfile = DoctorProfileModel.fromJson(profile);
if (doctorProfile != null) {
return doctorProfile;
}
}
return null;
} else {
return doctorProfile;
}
}
} }

@ -159,7 +159,6 @@ class TranslationBase {
String get startScanning => localizedValues['startScanning'][locale.languageCode]; String get startScanning => localizedValues['startScanning'][locale.languageCode];
String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode];
String get scanERQrCode => localizedValues['scanERQrCode'][locale.languageCode];
String get scanQr => localizedValues['scanQr'][locale.languageCode]; String get scanQr => localizedValues['scanQr'][locale.languageCode];
@ -1699,7 +1698,7 @@ class TranslationBase {
String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode]; String get reasonsThrombo => localizedValues['reasonsThrombo'][locale.languageCode];
String get youDoNotHaveFavoriteTemplate => localizedValues['youDoNotHaveFavoriteTemplate'][locale.languageCode]; String get youDoNotHaveFavoritePrescription => localizedValues['youDoNotHaveFavoritePrescription'][locale.languageCode];
String get pleaseSelectItem => localizedValues['pleaseSelectItem'][locale.languageCode]; String get pleaseSelectItem => localizedValues['pleaseSelectItem'][locale.languageCode];

@ -91,10 +91,6 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
TextInputType localKeyboardType = widget.inputType ??
(widget.maxLines == 1
? TextInputType.text
: TextInputType.multiline);
return Column( return Column(
children: [ children: [
@ -128,12 +124,17 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
// if ((widget.controller != null &&
// widget.controller.text != "") ||
// widget.dropDownText != null)
AppText( AppText(
widget.hintText, widget.hintText,
// marginTop: widget.hasHintmargin ? 0 : 30,
color: Color(0xFF2E303A), color: Color(0xFF2E303A),
fontSize: widget.isPrscription == false fontSize: widget.isPrscription == false
? 11.0 ? 11.0
// SizeConfig.getHeightMultiplier() *
// (SizeConfig.isWidthLarge ? 1.1 : 1.3)
: 0, : 0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
letterSpacing: -0.44, letterSpacing: -0.44,
@ -145,19 +146,6 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
widget.height != 0 && widget.maxLines == 1 widget.height != 0 && widget.maxLines == 1
? widget.height - 22 ? widget.height - 22
: null, : null,
child: RawKeyboardListener(
focusNode: FocusNode(),
autofocus: false,
onKey: (rawKeyEvent) {
final isFormSkippedEnterEvent = rawKeyEvent is RawKeyDownEvent &&
rawKeyEvent.isKeyPressed(LogicalKeyboardKey.enter);
final needToInsertNewLine = isFormSkippedEnterEvent &&
localKeyboardType == TextInputType.multiline;
if (needToInsertNewLine) {
TextEditingControllerHelper.insertText(widget.controller, '\n');
}
},
child: TextFormField( child: TextFormField(
textAlign: projectViewModel.isArabic textAlign: projectViewModel.isArabic
? TextAlign.right ? TextAlign.right
@ -175,7 +163,10 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
letterSpacing: -0.56, letterSpacing: -0.56,
), ),
controller: widget.controller, controller: widget.controller,
keyboardType: localKeyboardType, keyboardType: widget.inputType ??
(widget.maxLines == 1
? TextInputType.text
: TextInputType.multiline),
enabled: widget.enabled, enabled: widget.enabled,
minLines: widget.minLines, minLines: widget.minLines,
maxLines: widget.maxLines, maxLines: widget.maxLines,
@ -191,7 +182,6 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
}, },
onFieldSubmitted: widget.onFieldSubmitted, onFieldSubmitted: widget.onFieldSubmitted,
obscureText: widget.isSecure), obscureText: widget.isSecure),
),
) )
: AppText( : AppText(
Utils.convertToTitleCase(widget.dropDownText), Utils.convertToTitleCase(widget.dropDownText),
@ -234,24 +224,3 @@ class _AppTextFieldCustomState extends State<AppTextFieldCustom> {
); );
} }
} }
class TextEditingControllerHelper {
static insertText(TextEditingController controller, String textToInsert) {
final selection = controller.selection;
final cursorPosition = selection.base.offset;
if (cursorPosition < 0) {
controller.text += textToInsert;
return;
}
final text = controller.text;
final newText =
text.replaceRange(selection.start, selection.end, textToInsert);
controller.value = controller.value.copyWith(
text: newText,
selection: TextSelection.collapsed(
offset: selection.baseOffset + textToInsert.length,
),
);
}
}
Loading…
Cancel
Save