Merge branch 'development' of https://gitlab.com/Cloud_Solution/doctor_app_flutter into design-updates

 Conflicts:
	lib/config/localized_values.dart
	lib/landing_page.dart
	lib/screens/patients/profile/refer_patient_screen.dart
merge-requests/195/head
hussam al-habibeh 5 years ago
commit 7de6a8e99f

1
.gitignore vendored

@ -29,6 +29,7 @@
.pub-cache/ .pub-cache/
.pub/ .pub/
/build/ /build/
pubspec.lock # Except for application packages
# Web related # Web related
lib/generated_plugin_registrant.dart lib/generated_plugin_registrant.dart

Binary file not shown.

After

Width:  |  Height:  |  Size: 743 B

@ -3,7 +3,7 @@ import 'dart:convert';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
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/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:http/http.dart' as http; import 'package:http/http.dart' as http;

@ -222,10 +222,10 @@ const Map<String, Map<String, String>> localizedValues = {
'endcall': {'en': 'End Call', 'ar': 'إنهاء المكالمة'}, 'endcall': {'en': 'End Call', 'ar': 'إنهاء المكالمة'},
'transfertoadmin': {'en': 'Transfer to admin', 'ar': 'نقل إلى المسؤول'}, 'transfertoadmin': {'en': 'Transfer to admin', 'ar': 'نقل إلى المسؤول'},
"searchMedicineImageCaption": { "searchMedicineImageCaption": {
'en': 'Type or speak the medicine name to search', 'en': 'Type the medicine name to search',
'ar': ' اكتب أو انطق اسم الدواء للبحث' 'ar': ' اكتب اسم الدواء للبحث'
}, },
"type": {'en': 'Type or Speak', 'ar': 'اكتب أو تحدث '}, "type": {'en': 'Type ', 'ar': 'اكتب'},
"fromDate": {'en': 'From Date', 'ar': 'من تاريخ'}, "fromDate": {'en': 'From Date', 'ar': 'من تاريخ'},
"toDate": {'en': 'To Date', 'ar': 'الى تاريخ'}, "toDate": {'en': 'To Date', 'ar': 'الى تاريخ'},
"searchPatientImageCaptionTitle": { "searchPatientImageCaptionTitle": {
@ -242,6 +242,7 @@ const Map<String, Map<String, String>> localizedValues = {
'ar': 'لا يوجد اي نتائج' 'ar': 'لا يوجد اي نتائج'
}, },
'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'}, 'typeMedicineName': {'en': 'Type Medicine Name', 'ar': 'اكتب اسم الدواء'},
'moreThan3Letter': { 'moreThan3Letter': {
'en': 'Medicine Name Should Be More Than 3 letter', 'en': 'Medicine Name Should Be More Than 3 letter',
'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف' 'ar': 'يجب أن يكون اسم الدواء أكثر من 3 أحرف'
@ -249,4 +250,8 @@ const Map<String, Map<String, String>> localizedValues = {
'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '}, 'gender2': {'en': 'Gender: ', 'ar': 'الجنس: '},
'age2': {'en': 'Age: ', 'ar': 'العمر: '}, 'age2': {'en': 'Age: ', 'ar': 'العمر: '},
'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '}, 'referralPatient': {'en': 'Referral Patient', 'ar': 'المريض المحال '},
'replySuccessfully': {
'en': 'Reply Successfully',
'ar': 'تم الرد بنجاح'
},
}; };

@ -1,23 +0,0 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
///This service just an example
class HospitalService extends BaseService {
List<HospitalsModel> _hospitals = List();
List<HospitalsModel> get hospitals => _hospitals;
Future getHospitals() async {
await baseAppClient.post(GET_PROJECTS,
onSuccess: (dynamic response, int statusCode) {
_hospitals.clear();
response['ListProject'].forEach((hospital) {
_hospitals.add(HospitalsModel.fromJson(hospital));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: Map());
}
}

@ -0,0 +1,49 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/request_schedule.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart';
class MedicineService extends BaseService {
var _pharmacyItemsList = [];
var _pharmaciesList = [];
get pharmacyItemsList => _pharmacyItemsList;
get pharmaciesList => _pharmaciesList;
PharmaciesItemsRequestModel _itemsRequestModel =
PharmaciesItemsRequestModel();
PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel();
Future getMedicineItem(String itemName) async {
_itemsRequestModel.pHRItemName = itemName;
await baseAppClient.post(
PHARMACY_ITEMS_URL,
onSuccess: (dynamic response, int statusCode) {
_pharmacyItemsList.clear();
_pharmacyItemsList = response['ListPharmcy_Region_enh'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _itemsRequestModel.toJson(),
);
}
Future getPharmaciesList(int itemId) async {
_listRequestModel.itemID = itemId;
await baseAppClient.post(
PHARMACY_LIST_URL,
onSuccess: (dynamic response, int statusCode) {
_pharmaciesList.clear();
_pharmaciesList = response['PharmList'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _listRequestModel.toJson(),
);
}
}

@ -0,0 +1,412 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/core/service/base/base_service.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/request_schedule.dart';
import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result_req_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology/radiology_res_model.dart';
import 'package:doctor_app_flutter/models/patient/refer_to_doctor_request.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
class PatientService extends BaseService {
List<VitalSignResModel> _patientVitalSignList = [];
List<VitalSignResModel> patientVitalSignOrderdSubList = [];
List<VitalSignResModel> get patientVitalSignList => _patientVitalSignList;
List<LabOrdersResModel> _patientLabResultOrdersList = [];
List<LabOrdersResModel> get patientLabResultOrdersList =>
_patientLabResultOrdersList;
List<PrescriptionResModel> get patientPrescriptionsList =>
_patientPrescriptionsList;
List<PrescriptionResModel> _patientPrescriptionsList = [];
List<PrescriptionReportForInPatient> get prescriptionReportForInPatientList =>
_prescriptionReportForInPatientList;
List<PrescriptionReportForInPatient> _prescriptionReportForInPatientList = [];
List<RadiologyResModel> _patientRadiologyList = [];
List<RadiologyResModel> get patientRadiologyList => _patientRadiologyList;
List<PrescriptionReport> _prescriptionReport = [];
List<PrescriptionReport> get prescriptionReport => _prescriptionReport;
List<LabResult> _labResultList = [];
List<LabResult> get labResultList => _labResultList;
// TODO: replace var with model
var _patientProgressNoteList = [];
get patientProgressNoteList => _patientProgressNoteList;
// TODO: replace var with model
var _insuranceApporvalsList = [];
get insuranceApporvalsList => _insuranceApporvalsList;
// TODO: replace var with model
var _doctorsList = [];
get doctorsList => _doctorsList;
// TODO: replace var with model
var _clinicsList = [];
get clinicsList => _clinicsList;
// TODO: replace var with model
var _referalFrequancyList = [];
get referalFrequancyList => _referalFrequancyList;
DoctorsByClinicIdRequest _doctorsByClinicIdRequest =
DoctorsByClinicIdRequest();
STPReferralFrequencyRequest _referralFrequencyRequest =
STPReferralFrequencyRequest();
ClinicByProjectIdRequest _clinicByProjectIdRequest =
ClinicByProjectIdRequest();
ReferToDoctorRequest _referToDoctorRequest;
RequestSchedule _requestSchedule = RequestSchedule();
Future<dynamic> getPatientList(PatientModel patient, patientType) async {
hasError = false;
int val = int.parse(patientType);
dynamic localRes;
await baseAppClient.post(
GET_PATIENT + SERVICES_PATIANT[val],
onSuccess: (dynamic response, int statusCode) {
localRes = response;
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: {
"ProjectID": patient.ProjectID,
"ClinicID": patient.ClinicID,
"DoctorID": patient.DoctorID,
"FirstName": patient.FirstName,
"MiddleName": patient.MiddleName,
"LastName": patient.LastName,
"PatientMobileNumber": patient.PatientMobileNumber,
"PatientIdentificationID": patient.PatientIdentificationID,
"PatientID": patient.PatientID,
"From": patient.From,
"To": patient.To,
"LanguageID": patient.LanguageID,
"stamp": patient.stamp,
"IPAdress": patient.IPAdress,
"VersionID": patient.VersionID,
"Channel": patient.Channel,
"TokenID": patient.TokenID,
"SessionID": patient.SessionID,
"IsLoginForDoctorApp": patient.IsLoginForDoctorApp,
"PatientOutSA": patient.PatientOutSA
},
);
return Future.value(localRes);
}
Future getPatientVitalSign(patient) async {
hasError = false;
await baseAppClient.post(
GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
_patientVitalSignList = [];
response['List_DoctorPatientVitalSign'].forEach((v) {
_patientVitalSignList.add(new VitalSignResModel.fromJson(v));
});
if (_patientVitalSignList.length > 0) {
List<VitalSignResModel> patientVitalSignOrderdSubListTemp = [];
patientVitalSignOrderdSubListTemp = _patientVitalSignList;
patientVitalSignOrderdSubListTemp
.sort((VitalSignResModel a, VitalSignResModel b) {
return b.vitalSignDate.microsecondsSinceEpoch -
a.vitalSignDate.microsecondsSinceEpoch;
});
patientVitalSignOrderdSubList.clear();
int length = patientVitalSignOrderdSubListTemp.length >= 20
? 20
: patientVitalSignOrderdSubListTemp.length;
for (int x = 0; x < length; x++) {
patientVitalSignOrderdSubList
.add(patientVitalSignOrderdSubListTemp[x]);
}
}
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getLabResultOrders(patient) async {
hasError = false;
await baseAppClient.post(
GET_PATIENT_LAB_OREDERS,
onSuccess: (dynamic response, int statusCode) {
_patientLabResultOrdersList = [];
response['List_GetLabOreders'].forEach((v) {
_patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getOutPatientPrescriptions(patient) async {
hasError = false;
await baseAppClient.post(
GET_PRESCRIPTION,
onSuccess: (dynamic response, int statusCode) {
_patientPrescriptionsList = [];
response['PatientPrescriptionList'].forEach((v) {
_patientPrescriptionsList.add(new PrescriptionResModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getInPatientPrescriptions(patient) async {
hasError = false;
await baseAppClient.post(
GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT,
onSuccess: (dynamic response, int statusCode) {
_prescriptionReportForInPatientList = [];
response['List_PrescriptionReportForInPatient'].forEach((v) {
prescriptionReportForInPatientList
.add(PrescriptionReportForInPatient.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getPrescriptionReport(prescriptionReqModel) async {
hasError = false;
await baseAppClient.post(
GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) {
_prescriptionReport = [];
response['ListPRM'].forEach((v) {
_prescriptionReport.add(PrescriptionReport.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: prescriptionReqModel,
);
}
Future getPatientRadiology(patient) async {
hasError = false;
await baseAppClient.post(
GET_RADIOLOGY,
onSuccess: (dynamic response, int statusCode) {
_patientRadiologyList = [];
response['List_GetRadOreders'].forEach((v) {
_patientRadiologyList.add(new RadiologyResModel.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getLabResult(LabOrdersResModel labOrdersResModel) async {
hasError = false;
RequestLabResult requestLabResult = RequestLabResult();
requestLabResult.sessionID = labOrdersResModel.setupID;
requestLabResult.orderNo = labOrdersResModel.orderNo;
requestLabResult.invoiceNo = labOrdersResModel.invoiceNo;
requestLabResult.patientTypeID = labOrdersResModel.patientType;
await baseAppClient.post(
GET_PATIENT_LAB_RESULTS,
onSuccess: (dynamic response, int statusCode) {
_labResultList = [];
response['List_GetLabNormal'].forEach((v) {
_labResultList.add(new LabResult.fromJson(v));
});
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: requestLabResult.toJson(),
);
}
Future getPatientInsuranceApprovals(patient) async {
hasError = false;
await baseAppClient.post(
PATIENT_INSURANCE_APPROVALS_URL,
onSuccess: (dynamic response, int statusCode) {
_insuranceApporvalsList = [];
_insuranceApporvalsList = response['List_ApprovalMain_InPatient'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getPatientProgressNote(patient) async {
hasError = false;
await baseAppClient.post(
PATIENT_PROGRESS_NOTE_URL,
onSuccess: (dynamic response, int statusCode) {
_patientProgressNoteList = [];
_patientProgressNoteList = response['List_GetPregressNoteForInPatient'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: patient,
);
}
Future getClinicsList() async {
hasError = false;
await baseAppClient.post(
PATIENT_GET_CLINIC_BY_PROJECT_URL,
onSuccess: (dynamic response, int statusCode) {
_clinicsList = [];
_clinicsList = response['List_Clinic_All'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _clinicByProjectIdRequest.toJson(),
);
}
Future getReferralFrequancyList() async {
hasError = false;
await baseAppClient.post(
PATIENT_GET_LIST_REFERAL_URL,
onSuccess: (dynamic response, int statusCode) {
_referalFrequancyList = [];
_referalFrequancyList = response['list_STPReferralFrequency'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _referralFrequencyRequest.toJson(),
);
}
Future getDoctorsList(String clinicId) async {
hasError = false;
_doctorsByClinicIdRequest.clinicID = clinicId;
await baseAppClient.post(
PATIENT_GET_DOCTOR_BY_CLINIC_URL,
onSuccess: (dynamic response, int statusCode) {
_doctorsList = [];
_doctorsList = response['List_Doctors_All'];
},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _doctorsByClinicIdRequest.toJson(),
);
}
// TODO send the total model insted of each parameter
Future referToDoctor({String selectedDoctorID,
String selectedClinicID,
int admissionNo,
String extension,
String priority,
String frequency,
String referringDoctorRemarks,
int patientID,
int patientTypeID,
String roomID,
int projectID}) async {
hasError = false;
// TODO Change it to use it when we implement authentication user
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile);
int doctorID = doctorProfile.doctorID;
int clinicId = doctorProfile.clinicID;
_referToDoctorRequest = ReferToDoctorRequest(
projectID: projectID,
admissionNo: admissionNo,
roomID: roomID,
referralClinic: selectedClinicID.toString(),
referralDoctor: selectedDoctorID.toString(),
createdBy: doctorID,
editedBy: doctorID,
patientID: patientID,
patientTypeID: patientTypeID,
referringClinic: clinicId,
referringDoctor: doctorID,
referringDoctorRemarks: referringDoctorRemarks,
priority: priority,
frequency: frequency,
extension: extension,
);
await baseAppClient.post(
PATIENT_PROGRESS_NOTE_URL,
onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
},
body: _referToDoctorRequest.toJson(),
);
}
}

@ -5,12 +5,12 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import '../models/doctor/user_model.dart'; import '../../models/doctor/user_model.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED }
class AuthProvider with ChangeNotifier { class AuthViewModel with ChangeNotifier {
List<ClinicModel> doctorsClinicList = []; List<ClinicModel> doctorsClinicList = [];
String selectedClinicName; String selectedClinicName;
bool isLogin = false; bool isLogin = false;
@ -23,7 +23,7 @@ class AuthProvider with ChangeNotifier {
} }
AuthProvider() { AuthViewModel() {
getUserAuthentication(); getUserAuthentication();
} }

@ -1,7 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart';
import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart'; import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/hospital/hospitals_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import '../../locator.dart'; import '../../locator.dart';

@ -1,23 +1,31 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/service/hospital/hospitals_service.dart'; import 'package:flutter/cupertino.dart';
import '../../locator.dart'; // TODO change it when change login
import 'base_view_model.dart'; class HospitalViewModel with ChangeNotifier {
BaseAppClient baseAppClient = BaseAppClient();
///This View Model just an example Future<Map> getProjectsList() async {
class HospitalViewModel extends BaseViewModel { const url = GET_PROJECTS;
HospitalService _hospitalService = locator<HospitalService>(); // TODO create model or remove it if no info need
var info = {
"LanguageID": 1,
"stamp": "2020-02-26T13:51:44.111Z",
"IPAdress": "11.11.11.11",
"VersionID": 1.2,
"Channel": 9,
"TokenID": "",
"SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true
};
dynamic localRes;
List<HospitalsModel> get hospitals => _hospitalService.hospitals; await baseAppClient.post(url, onSuccess: (response, statusCode) async {
localRes = response;
Future getHospitals() async { }, onFailure: (String error, int statusCode) {
setState(ViewState.Busy); throw error;
await _hospitalService.getHospitals(); }, body: info);
if (_hospitalService.hasError) { return Future.value(localRes);
error = _hospitalService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
} }
} }

@ -1,7 +1,7 @@
import 'dart:convert';
import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/livecare/end_call_req.dart'; import 'package:doctor_app_flutter/models/livecare/end_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/get_panding_req_list.dart'; import 'package:doctor_app_flutter/models/livecare/get_panding_req_list.dart';
import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart'; import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart';
@ -9,11 +9,10 @@ import 'package:doctor_app_flutter/models/livecare/start_call_req.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; import 'package:doctor_app_flutter/models/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart'; import 'package:doctor_app_flutter/models/livecare/transfer_to_admin.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
class LiveCareProvider with ChangeNotifier { //TODO: change it when Live care return back.
class LiveCareViewModel with ChangeNotifier {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
List<LiveCarePendingListResponse> liveCarePendingList = []; List<LiveCarePendingListResponse> liveCarePendingList = [];

@ -0,0 +1,32 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/medicine_service.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class MedicineViewModel extends BaseViewModel {
MedicineService _medicineService = locator<MedicineService>();
get pharmacyItemsList => _medicineService.pharmacyItemsList;
get pharmaciesList => _medicineService.pharmaciesList;
Future getMedicineItem(String itemName) async {
setState(ViewState.Busy);
await _medicineService.getMedicineItem(itemName);
if (_medicineService.hasError) {
error = _medicineService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPharmaciesList(int itemId) async {
setState(ViewState.Busy);
await _medicineService.getPharmaciesList(itemId);
if (_medicineService.hasError) {
error = _medicineService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -0,0 +1,244 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology/radiology_res_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_res_model.dart';
import '../../locator.dart';
import 'base_view_model.dart';
class PatientViewModel extends BaseViewModel {
PatientService _patientService = locator<PatientService>();
List<VitalSignResModel> get patientVitalSignList =>
_patientService.patientVitalSignList;
List<VitalSignResModel> get patientVitalSignOrderdSubList =>
_patientService.patientVitalSignOrderdSubList;
List<LabOrdersResModel> get patientLabResultOrdersList =>
_patientService.patientLabResultOrdersList;
List<PrescriptionResModel> get patientPrescriptionsList =>
_patientService.patientPrescriptionsList;
List<PrescriptionReportForInPatient> get prescriptionReportForInPatientList =>
_patientService.prescriptionReportForInPatientList;
List<PrescriptionReport> get prescriptionReport =>
_patientService.prescriptionReport;
List<RadiologyResModel> get patientRadiologyList =>
_patientService.patientRadiologyList;
List<LabResult> get labResultList => _patientService.labResultList;
get insuranceApporvalsList => _patientService.insuranceApporvalsList;
get patientProgressNoteList => _patientService.patientProgressNoteList;
get clinicsList => _patientService.clinicsList;
get doctorsList => _patientService.doctorsList;
get referalFrequancyList => _patientService.referalFrequancyList;
Future getPatientList(PatientModel patient, patientType,
{bool isBusyLocal = false}) async {
if(isBusyLocal) {
setState(ViewState.BusyLocal);
} else {
setState(ViewState.Busy);
}
return _patientService.getPatientList(patient, patientType);
if (_patientService.hasError) {
error = _patientService.error;
if(isBusyLocal) {
setState(ViewState.ErrorLocal);
} else {
setState(ViewState.Error);
} } else
setState(ViewState.Idle);
}
Future getPatientVitalSign(patient) async {
setState(ViewState.Busy);
await _patientService.getPatientVitalSign(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getLabResultOrders(patient) async {
setState(ViewState.Busy);
await _patientService.getLabResultOrders(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getOutPatientPrescriptions(patient) async {
setState(ViewState.Busy);
await _patientService.getOutPatientPrescriptions(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getInPatientPrescriptions(patient) async {
setState(ViewState.Busy);
await _patientService.getInPatientPrescriptions(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPrescriptionReport(patient) async {
setState(ViewState.Busy);
await _patientService.getPrescriptionReport(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientRadiology(patient) async {
setState(ViewState.Busy);
await _patientService.getPatientRadiology(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getLabResult(LabOrdersResModel labOrdersResModel) async {
setState(ViewState.Busy);
await _patientService.getLabResult(labOrdersResModel);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientInsuranceApprovals(patient) async {
setState(ViewState.Busy);
await _patientService.getPatientInsuranceApprovals(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getPatientProgressNote(patient) async {
setState(ViewState.Busy);
await _patientService.getPatientProgressNote(patient);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
Future getClinicsList() async {
setState(ViewState.Busy);
await _patientService.getClinicsList();
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else {
{
await getReferralFrequancyList();
setState(ViewState.Idle);
}
}
}
Future getDoctorsList(String clinicId) async {
setState(ViewState.BusyLocal);
await _patientService.getDoctorsList(clinicId);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.ErrorLocal);
} else {
{
await getReferralFrequancyList();
setState(ViewState.Idle);
}
}
}
List getDoctorNameList() {
var doctorNamelist =
_patientService.doctorsList.map((value) => value['DoctorName'].toString()).toList();
return doctorNamelist;
}
List getClinicNameList() {
var clinicsNameslist = _patientService.clinicsList
.map((value) => value['ClinicDescription'].toString())
.toList();
return clinicsNameslist;
}
Future getReferralFrequancyList() async {
setState(ViewState.Busy);
await _patientService.getReferralFrequancyList();
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
List getReferralNamesList() {
var referralNamesList = _patientService.referalFrequancyList
.map((value) => value['Description'].toString())
.toList();
return referralNamesList;
}
Future referToDoctor(
{String selectedDoctorID,
String selectedClinicID,
int admissionNo,
String extension,
String priority,
String frequency,
String referringDoctorRemarks,
int patientID,
int patientTypeID,
String roomID,
int projectID}) async {
setState(ViewState.BusyLocal);
await _patientService.referToDoctor(
selectedClinicID: selectedClinicID,
selectedDoctorID: selectedDoctorID,
admissionNo: admissionNo,
extension: extension,
priority: priority,
frequency: frequency,
referringDoctorRemarks: referringDoctorRemarks,
patientID: patientID,
patientTypeID: patientTypeID,
roomID: roomID,
projectID: projectID);
if (_patientService.hasError) {
error = _patientService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/providers/auth_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -121,7 +121,7 @@ class ProjectProvider with ChangeNotifier {
tokenID: '', tokenID: '',
languageID: 2); languageID: 2);
Provider.of<AuthProvider>(AppGlobal.CONTEX, listen: false) Provider.of<AuthViewModel>(AppGlobal.CONTEX, listen: false)
.getDocProfiles(docInfo.toJson()) .getDocProfiles(docInfo.toJson())
.then((res) async { .then((res) async {
sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]);

@ -1,11 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart';
import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/hospital/hospitals_service.dart';
import 'package:doctor_app_flutter/core/service/referral_patient_service.dart'; import 'package:doctor_app_flutter/core/service/referral_patient_service.dart';
import 'package:doctor_app_flutter/core/service/schedule_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart';
import '../../locator.dart'; import '../../locator.dart';

@ -1,13 +1,5 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart';
import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/hospital/hospitals_service.dart';
import 'package:doctor_app_flutter/core/service/referral_patient_service.dart';
import 'package:doctor_app_flutter/core/service/referred_patient_service.dart'; import 'package:doctor_app_flutter/core/service/referred_patient_service.dart';
import 'package:doctor_app_flutter/core/service/schedule_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referral_patient_model.dart';
import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart'; import 'package:doctor_app_flutter/models/patient/my_referral/my_referred_patient_model.dart';
import '../../locator.dart'; import '../../locator.dart';

@ -1,10 +1,6 @@
import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart';
import 'package:doctor_app_flutter/core/model/hospitals_model.dart';
import 'package:doctor_app_flutter/core/service/doctor_reply_service.dart';
import 'package:doctor_app_flutter/core/service/hospital/hospitals_service.dart';
import 'package:doctor_app_flutter/core/service/schedule_service.dart'; import 'package:doctor_app_flutter/core/service/schedule_service.dart';
import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart';
import 'package:doctor_app_flutter/models/doctor/list_gt_my_patients_question_model.dart';
import '../../locator.dart'; import '../../locator.dart';
import 'base_view_model.dart'; import 'base_view_model.dart';

@ -39,8 +39,10 @@ class _LandingPageState extends State<LandingPage> {
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
elevation: 0, elevation: 0,
backgroundColor: Hexcolor('#515B5D'), backgroundColor: HexColor('#515B5D'),
textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), textTheme: TextTheme(
headline6:
TextStyle(color: Colors.white)),
title: Text(getText(currentTab).toUpperCase()), title: Text(getText(currentTab).toUpperCase()),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {

@ -1,12 +1,14 @@
import 'package:doctor_app_flutter/core/service/patient_service.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'core/service/doctor_reply_service.dart'; import 'core/service/doctor_reply_service.dart';
import 'core/service/hospital/hospitals_service.dart'; import 'core/service/medicine_service.dart';
import 'core/service/referral_patient_service.dart'; import 'core/service/referral_patient_service.dart';
import 'core/service/referred_patient_service.dart'; import 'core/service/referred_patient_service.dart';
import 'core/service/schedule_service.dart'; import 'core/service/schedule_service.dart';
import 'core/viewModel/doctor_replay_view_model.dart'; import 'core/viewModel/doctor_replay_view_model.dart';
import 'core/viewModel/hospital_view_model.dart'; import 'core/viewModel/medicine_view_model.dart';
import 'core/viewModel/referral_view_model.dart'; import 'core/viewModel/referral_view_model.dart';
import 'core/viewModel/referred_view_model.dart'; import 'core/viewModel/referred_view_model.dart';
import 'core/viewModel/schedule_view_model.dart'; import 'core/viewModel/schedule_view_model.dart';
@ -16,16 +18,18 @@ GetIt locator = GetIt.instance;
///di ///di
void setupLocator() { void setupLocator() {
/// Services /// Services
locator.registerLazySingleton(() => HospitalService());
locator.registerLazySingleton(() => DoctorReplyService()); locator.registerLazySingleton(() => DoctorReplyService());
locator.registerLazySingleton(() => ScheduleService()); locator.registerLazySingleton(() => ScheduleService());
locator.registerLazySingleton(() => ReferralPatientService()); locator.registerLazySingleton(() => ReferralPatientService());
locator.registerLazySingleton(() => ReferredPatientService()); locator.registerLazySingleton(() => ReferredPatientService());
locator.registerLazySingleton(() => MedicineService());
locator.registerLazySingleton(() => PatientService());
/// View Model /// View Model
locator.registerFactory(() => HospitalViewModel());
locator.registerFactory(() => DoctorReplayViewModel()); locator.registerFactory(() => DoctorReplayViewModel());
locator.registerFactory(() => ScheduleViewModel()); locator.registerFactory(() => ScheduleViewModel());
locator.registerFactory(() => ReferralPatientViewModel()); locator.registerFactory(() => ReferralPatientViewModel());
locator.registerFactory(() => ReferredPatientViewModel()); locator.registerFactory(() => ReferredPatientViewModel());
locator.registerFactory(() => MedicineViewModel());
locator.registerFactory(() => PatientViewModel());
} }

@ -1,6 +1,5 @@
import 'package:doctor_app_flutter/providers/livecare_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
@ -8,9 +7,8 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import './config/size_config.dart'; import './config/size_config.dart';
import './providers/auth_provider.dart'; import 'core/viewModel/auth_view_model.dart';
import './providers/patients_provider.dart'; import 'core/viewModel/hospital_view_model.dart';
import './providers/hospital_provider.dart';
import './routes.dart'; import './routes.dart';
import 'config/config.dart'; import 'config/config.dart';
import 'locator.dart'; import 'locator.dart';
@ -31,19 +29,16 @@ class MyApp extends StatelessWidget {
SizeConfig().init(constraints, orientation); SizeConfig().init(constraints, orientation);
return MultiProvider( return MultiProvider(
providers: [ providers: [
ChangeNotifierProvider<PatientsProvider>( ChangeNotifierProvider<AuthViewModel>(
create: (context) => PatientsProvider()), create: (context) => AuthViewModel()),
ChangeNotifierProvider<AuthProvider>( ChangeNotifierProvider<HospitalViewModel>(
create: (context) => AuthProvider()), create: (context) => HospitalViewModel()),
ChangeNotifierProvider<HospitalProvider>(
create: (context) => HospitalProvider()),
ChangeNotifierProvider<ProjectProvider>( ChangeNotifierProvider<ProjectProvider>(
create: (context) => ProjectProvider(), create: (context) => ProjectProvider(),
), ),
ChangeNotifierProvider<LiveCareProvider>( ChangeNotifierProvider<LiveCareViewModel>(
create: (context) => LiveCareProvider(), create: (context) => LiveCareViewModel(),
), ),
ChangeNotifierProvider<MedicineProvider>(create: (context) => MedicineProvider(),),
], ],
child: Consumer<ProjectProvider>( child: Consumer<ProjectProvider>(
builder: (context,projectProvider,child) => MaterialApp( builder: (context,projectProvider,child) => MaterialApp(
@ -62,7 +57,7 @@ class MyApp extends StatelessWidget {
theme: ThemeData( theme: ThemeData(
primarySwatch: Colors.grey, primarySwatch: Colors.grey,
primaryColor: Colors.grey, primaryColor: Colors.grey,
buttonColor: Hexcolor('#B8382C'), buttonColor: HexColor('#B8382C'),
fontFamily: 'WorkSans', fontFamily: 'WorkSans',
dividerColor: Colors.grey[350], dividerColor: Colors.grey[350],
backgroundColor: Color.fromRGBO(255,255,255, 1) backgroundColor: Color.fromRGBO(255,255,255, 1)

@ -1,29 +0,0 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:flutter/cupertino.dart';
class HospitalProvider with ChangeNotifier {
BaseAppClient baseAppClient = BaseAppClient();
Future<Map> getProjectsList() async {
const url = GET_PROJECTS;
var info = {
"LanguageID": 1,
"stamp": "2020-02-26T13:51:44.111Z",
"IPAdress": "11.11.11.11",
"VersionID": 1.2,
"Channel": 9,
"TokenID": "",
"SessionID": "i1UJwCTSqt",
"IsLoginForDoctorApp": true
};
dynamic localRes;
await baseAppClient.post(url, onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: info);
return Future.value(localRes);
}
}

@ -1,78 +0,0 @@
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_List_request_model.dart';
import 'package:doctor_app_flutter/models/pharmacies/pharmacies_items_request_model.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart';
class MedicineProvider with ChangeNotifier {
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
var pharmacyItemsList = [];
var pharmaciesList = [];
bool isFinished = true;
bool hasError = false;
String errorMsg = '';
BaseAppClient baseAppClient = BaseAppClient();
PharmaciesItemsRequestModel _itemsRequestModel =
PharmaciesItemsRequestModel();
PharmaciesListRequestModel _listRequestModel = PharmaciesListRequestModel();
clearPharmacyItemsList() {
pharmacyItemsList.clear();
notifyListeners();
}
getMedicineItem(String itemName) async {
_itemsRequestModel.pHRItemName = itemName;
resetDefaultValues();
pharmacyItemsList.clear();
notifyListeners();
try {
await baseAppClient.post(PHARMACY_ITEMS_URL,
onSuccess: (dynamic response, int statusCode) {
pharmacyItemsList = response['ListPharmcy_Region_enh'];
hasError = false;
isFinished = true;
errorMsg = "Done";
}, onFailure: (String error, int statusCode) {
isFinished = true;
hasError = true;
errorMsg = error;
}, body: _itemsRequestModel.toJson());
notifyListeners();
} catch (error) {
throw error;
}
}
getPharmaciesList(int itemId) async {
resetDefaultValues();
try {
_listRequestModel.itemID = itemId;
isFinished = false;
await baseAppClient.post(PHARMACY_LIST_URL,
onSuccess: (dynamic response, int statusCode) {
pharmaciesList = response['PharmList'];
hasError = false;
isFinished = true;
errorMsg = "Done";
}, onFailure: (String error, int statusCode) {
isFinished = true;
hasError = true;
errorMsg = error;
}, body: _listRequestModel.toJson());
notifyListeners();
} catch (error) {
throw error;
}
}
resetDefaultValues() {
isFinished = false;
hasError = false;
errorMsg = '';
notifyListeners();
}
}

@ -1,542 +0,0 @@
import 'dart:convert';
import 'package:doctor_app_flutter/client/base_app_client.dart';
import 'package:doctor_app_flutter/config/shared_pref_kay.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/patient/get_clinic_by_project_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_doctor_by_clinic_id_request.dart';
import 'package:doctor_app_flutter/models/patient/get_list_stp_referral_frequency_request.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result.dart';
import 'package:doctor_app_flutter/models/patient/lab_result/lab_result_req_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology/radiology_res_model.dart';
import 'package:doctor_app_flutter/models/patient/refer_to_doctor_request.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_report.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:flutter/cupertino.dart';
import '../config/config.dart';
import '../models/patient/lab_orders/lab_orders_res_model.dart';
import '../models/patient/patiant_info_model.dart';
import '../models/patient/patient_model.dart';
import '../models/patient/prescription/prescription_res_model.dart';
import '../models/patient/radiology/radiology_res_model.dart';
import '../models/patient/vital_sign/vital_sign_res_model.dart';
import '../util/helpers.dart';
Helpers helpers = Helpers();
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
class PatientsProvider with ChangeNotifier {
bool isLoading = false;
bool isError = false;
String error = '';
List<VitalSignResModel> patientVitalSignList = [];
List<VitalSignResModel> patientVitalSignOrderdSubList = [];
List<LabOrdersResModel> patientLabResultOrdersList = [];
List<PrescriptionResModel> patientPrescriptionsList = [];
List<RadiologyResModel> patientRadiologyList = [];
List<PrescriptionReportForInPatient> prescriptionReportForInPatientList = [];
List<PrescriptionReport> prescriptionReport = [];
BaseAppClient baseAppClient = BaseAppClient();
/*@author: ibrahe albitar
*@Date:2/6/2020
*@desc: getPatientPrescriptions
*/
List<LabResult> labResultList = [];
var patientProgressNoteList = [];
var insuranceApporvalsList = [];
var doctorsList = [];
var clinicsList = [];
var referalFrequancyList = [];
DoctorsByClinicIdRequest _doctorsByClinicIdRequest =
DoctorsByClinicIdRequest();
STPReferralFrequencyRequest _referralFrequencyRequest =
STPReferralFrequencyRequest();
ClinicByProjectIdRequest _clinicByProjectIdRequest =
ClinicByProjectIdRequest();
ReferToDoctorRequest _referToDoctorRequest;
PatiantInformtion _selectedPatient;
Future<dynamic> getPatientList(PatientModel patient, patientType) async {
int val = int.parse(patientType);
try {
dynamic localRes;
await baseAppClient.post(GET_PATIENT + SERVICES_PATIANT[val],
onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: {
"ProjectID": patient.ProjectID,
"ClinicID": patient.ClinicID,
"DoctorID": patient.DoctorID,
"FirstName": patient.FirstName,
"MiddleName": patient.MiddleName,
"LastName": patient.LastName,
"PatientMobileNumber": patient.PatientMobileNumber,
"PatientIdentificationID": patient.PatientIdentificationID,
"PatientID": patient.PatientID,
"From": patient.From,
"To": patient.To,
"LanguageID": patient.LanguageID,
"stamp": patient.stamp,
"IPAdress": patient.IPAdress,
"VersionID": patient.VersionID,
"Channel": patient.Channel,
"TokenID": patient.TokenID,
"SessionID": patient.SessionID,
"IsLoginForDoctorApp": patient.IsLoginForDoctorApp,
"PatientOutSA": patient.PatientOutSA
});
return Future.value(localRes);
} catch (error) {
print(error);
throw error;
}
}
setBasicData() {
isLoading = true;
isError = false;
error = '';
notifyListeners();
}
/*
*@author: Elham Rababah
*@Date:27/4/2020
*@param: patient
*@return:
*@desc: getPatientVitalSign
*/
getPatientVitalSign(patient) async {
setBasicData();
try {
await baseAppClient.post(GET_PATIENT_VITAL_SIGN,
onSuccess: (dynamic response, int statusCode) {
patientVitalSignList = [];
response['List_DoctorPatientVitalSign'].forEach((v) {
patientVitalSignList.add(new VitalSignResModel.fromJson(v));
});
if (patientVitalSignList.length > 0) {
List<VitalSignResModel> patientVitalSignOrderdSubListTemp = [];
patientVitalSignOrderdSubListTemp = patientVitalSignList;
patientVitalSignOrderdSubListTemp
.sort((VitalSignResModel a, VitalSignResModel b) {
return b.vitalSignDate.microsecondsSinceEpoch -
a.vitalSignDate.microsecondsSinceEpoch;
});
patientVitalSignOrderdSubList.clear();
int length = patientVitalSignOrderdSubListTemp.length >= 20
? 20
: patientVitalSignOrderdSubListTemp.length;
for (int x = 0; x < length; x++) {
patientVitalSignOrderdSubList
.add(patientVitalSignOrderdSubListTemp[x]);
}
}
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
/*@author: Elham Rababah
*@Date:27/4/2020
*@param: patient
*@return:
*@desc: getLabResult Orders
*/
getLabResultOrders(patient) async {
// isLoading = true;
// notifyListeners();
setBasicData();
try {
await baseAppClient.post(GET_PATIENT_LAB_OREDERS,
onSuccess: (dynamic response, int statusCode) {
patientLabResultOrdersList = [];
response['List_GetLabOreders'].forEach((v) {
patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v));
});
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
/*@author: Elham Rababah
*@Date:3/5/2020
*@param: patient
*@return:
*@desc: geOutPatientPrescriptions
*/
getOutPatientPrescriptions(patient) async {
setBasicData();
try {
await baseAppClient.post(GET_PRESCRIPTION,
onSuccess: (dynamic response, int statusCode) {
patientPrescriptionsList = [];
response['PatientPrescriptionList'].forEach((v) {
patientPrescriptionsList.add(new PrescriptionResModel.fromJson(v));
});
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
/*@author: Mohammad Aljammal
*@Date:4/6/2020
*@param: patient
*@return:
*@desc: getInPatientPrescriptions
*/
getInPatientPrescriptions(patient) async {
setBasicData();
try {
prescriptionReportForInPatientList = [];
notifyListeners();
await baseAppClient.post(GET_PRESCRIPTION_REPORT_FOR_IN_PATIENT,
onSuccess: (dynamic response, int statusCode) {
response['List_PrescriptionReportForInPatient'].forEach((v) {
prescriptionReportForInPatientList
.add(PrescriptionReportForInPatient.fromJson(v));
});
isError = false;
isLoading = false;
}, onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
getPrescriptionReport(prescriptionReqModel) async {
prescriptionReport = [];
isLoading = true;
isError = false;
error = "";
notifyListeners();
await baseAppClient.post(GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) {
response['ListPRM'].forEach((v) {
prescriptionReport.add(PrescriptionReport.fromJson(v));
});
isError = false;
isLoading = false;
}, onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
}, body: prescriptionReqModel);
notifyListeners();
}
/*@author: Elham Rababah
*@Date:12/5/2020
*@param: patient
*@return:
*@desc: getPatientRadiology
*/
handelCatchErrorCase(err) {
isLoading = false;
isError = true;
error = helpers.generateContactAdminMsg(err);
notifyListeners();
throw err;
}
/*@author: Elham Rababah
*@Date:3/5/2020
*@param: patient
*@return:
*@desc: getPatientRadiology
*/
getPatientRadiology(patient) async {
// isLoading = true;
// notifyListeners();
setBasicData();
try {
await baseAppClient.post(GET_RADIOLOGY,
onSuccess: (dynamic response, int statusCode) {
patientRadiologyList = [];
response['List_GetRadOreders'].forEach((v) {
patientRadiologyList.add(new RadiologyResModel.fromJson(v));
});
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
getLabResult(LabOrdersResModel labOrdersResModel) async {
labResultList.clear();
isLoading = true;
notifyListeners();
RequestLabResult requestLabResult = RequestLabResult();
requestLabResult.sessionID = labOrdersResModel.setupID;
requestLabResult.orderNo = labOrdersResModel.orderNo;
requestLabResult.invoiceNo = labOrdersResModel.invoiceNo;
requestLabResult.patientTypeID = labOrdersResModel.patientType;
await baseAppClient.post(GET_PATIENT_LAB_RESULTS,
onSuccess: (dynamic response, int statusCode) {
isError = false;
isLoading = false;
response['List_GetLabNormal'].forEach((v) {
labResultList.add(new LabResult.fromJson(v));
});
}, onFailure: (String error, int statusCode) {
isError = true;
isLoading = false;
this.error = error;
}, body: requestLabResult.toJson());
notifyListeners();
}
getPatientInsuranceApprovals(patient) async {
setBasicData();
try {
await baseAppClient.post(PATIENT_INSURANCE_APPROVALS_URL,
onSuccess: (dynamic response, int statusCode) {
insuranceApporvalsList = response['List_ApprovalMain_InPatient'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
/*@author: ibrahe albitar
*@Date:2/6/2020
*@desc: getPatientProgressNote
*/
getPatientProgressNote(patient) async {
setBasicData();
try {
await baseAppClient.post(PATIENT_PROGRESS_NOTE_URL,
onSuccess: (dynamic response, int statusCode) {
patientProgressNoteList = response['List_GetPregressNoteForInPatient'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: patient);
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
/*@author: ibrahem albitar
*@Date:3/6/2020
*@desc: getDoctorsList
*/
getDoctorsList(String clinicId) async {
setBasicData();
try {
_doctorsByClinicIdRequest.clinicID = clinicId;
await baseAppClient.post(PATIENT_GET_DOCTOR_BY_CLINIC_URL,
onSuccess: (dynamic response, int statusCode) {
doctorsList = response['List_Doctors_All'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: _doctorsByClinicIdRequest.toJson());
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
List getDoctorNameList() {
var doctorNamelist =
doctorsList.map((value) => value['DoctorName'].toString()).toList();
return doctorNamelist;
}
/*@author: ibrahem albitar
*@Date:3/6/2020
*@desc: getClinicsList
*/
getClinicsList() async {
setBasicData();
try {
await baseAppClient.post(PATIENT_GET_CLINIC_BY_PROJECT_URL,
onSuccess: (dynamic response, int statusCode) {
clinicsList = response['List_Clinic_All'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: _clinicByProjectIdRequest.toJson());
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
List getClinicNameList() {
var clinicsNameslist = clinicsList
.map((value) => value['ClinicDescription'].toString())
.toList();
return clinicsNameslist;
}
/*@author: ibrahem albitar
*@Date:3/6/2020
*@desc: getReferralFrequancyList
*/
getReferralFrequancyList() async {
setBasicData();
try {
await baseAppClient.post(PATIENT_GET_LIST_REFERAL_URL,
onSuccess: (dynamic response, int statusCode) {
referalFrequancyList = response['list_STPReferralFrequency'];
isLoading = false;
isError = false;
this.error = '';
}, onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
}, body: _referralFrequencyRequest.toJson());
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
List getReferralNamesList() {
var referralNamesList = referalFrequancyList
.map((value) => value['Description'].toString())
.toList();
return referralNamesList;
}
/*@author: ibrahem albitar
*@Date:3/6/2020
*@desc: referToDoctor
*/
referToDoctor(context,
{String selectedDoctorID,
String selectedClinicID,
int admissionNo,
String extension,
String priority,
String frequency,
String referringDoctorRemarks,
int patientID,
int patientTypeID,
String roomID,
int projectID}) async {
setBasicData();
try {
String token = await sharedPref.getString(TOKEN);
Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
DoctorProfileModel doctorProfile =
new DoctorProfileModel.fromJson(profile);
int doctorID = doctorProfile.doctorID;
int clinicId = doctorProfile.clinicID;
_referToDoctorRequest = ReferToDoctorRequest(
projectID: projectID,
admissionNo: admissionNo,
roomID: roomID,
referralClinic: selectedClinicID.toString(),
referralDoctor: selectedDoctorID.toString(),
createdBy: doctorID,
editedBy: doctorID,
patientID: patientID,
patientTypeID: patientTypeID,
referringClinic: clinicId,
referringDoctor: doctorID,
referringDoctorRemarks: referringDoctorRemarks,
priority: priority,
frequency: frequency,
extension: extension,
tokenID: token);
await baseAppClient.post(PATIENT_REFER_TO_DOCTOR_URL,
onSuccess: (dynamic response, int statusCode) {
// print('Done : \n $res');
Navigator.pop(context);
},
onFailure: (String error, int statusCode) {
isLoading = false;
isError = true;
this.error = error;
},
body: _referToDoctorRequest.toJson());
notifyListeners();
} catch (err) {
handelCatchErrorCase(err);
}
}
}

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/providers/auth_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/screens/auth/login_screen.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -11,7 +11,7 @@ import 'landing_page.dart';
class RootPage extends StatelessWidget { class RootPage extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthProvider authProvider = Provider.of(context); AuthViewModel authProvider = Provider.of(context);
Widget buildRoot() { Widget buildRoot() {
switch (authProvider.stutas) { switch (authProvider.stutas) {
case APP_STATUS.LOADING: case APP_STATUS.LOADING:

@ -32,7 +32,6 @@ import './screens/patients/profile/progress_note_screen.dart';
import './screens/patients/profile/radiology/radiology_screen.dart'; import './screens/patients/profile/radiology/radiology_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_item_details_screen.dart';
import './screens/patients/profile/vital_sign/vital_sign_screen.dart';
import './screens/profile_screen.dart'; import './screens/profile_screen.dart';
import './screens/settings/settings_screen.dart'; import './screens/settings/settings_screen.dart';
import 'landing_page.dart'; import 'landing_page.dart';
@ -96,7 +95,6 @@ var routes = {
PHARMACIES_LIST: (_) => PharmaciesListScreen( PHARMACIES_LIST: (_) => PharmaciesListScreen(
itemID: null, itemID: null,
), ),
VITAL_SIGN: (_) => VitalSignScreen(),
MESSAGES: (_) => MessagesScreen(), MESSAGES: (_) => MessagesScreen(),
SERVICES: (_) => ServicesScreen(), SERVICES: (_) => ServicesScreen(),
LAB_ORDERS: (_) => LabOrdersScreen(), LAB_ORDERS: (_) => LabOrdersScreen(),

@ -1,23 +1,23 @@
import 'package:barcode_scan/platform_wrapper.dart'; import 'package:barcode_scan/platform_wrapper.dart';
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/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bg_widget.dart';
import 'package: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:doctor_app_flutter/util/translations_delegate_base.dart';
import '../routes.dart'; import '../routes.dart';
import 'base/base_view.dart';
Helpers helpers = Helpers();
class QrReaderScreen extends StatefulWidget { class QrReaderScreen extends StatefulWidget {
@override @override
@ -55,18 +55,22 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<PatientViewModel>(
appBarTitle: TranslationBase.of(context).qr+ TranslationBase.of(context).reader, onModelReady: (model) => model.getClinicsList(),
body: Center( builder: (_, model, w) => AppScaffold(
child: Container( baseViewModel: model,
margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), appBarTitle:
child: FractionallySizedBox( TranslationBase.of(context).qr + TranslationBase.of(context).reader,
widthFactor: 0.9, body: Center(
child: ListView( child: Container(
children: [ margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7),
AppText( child: FractionallySizedBox(
TranslationBase.of(context).startScanning, widthFactor: 0.9,
fontSize: 18, child: ListView(
children: [
AppText(
TranslationBase.of(context).startScanning,
fontSize: 18,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
@ -89,7 +93,7 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
), ),
Button( Button(
onTap: () { onTap: () {
_scanQrAndGetPatient(context); _scanQrAndGetPatient(context, model);
}, },
title: TranslationBase.of(context).scanQr, title: TranslationBase.of(context).scanQr,
loading: isLoading, loading: isLoading,
@ -111,20 +115,22 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
error ?? error ??
TranslationBase.of(context) TranslationBase.of(context)
.errorMessage, .errorMessage,
color: Theme.of(context).errorColor)), color: Theme
.of(context)
.errorColor)),
], ],
), ),
) )
: Container(), : Container(),
], ],
),
),
),
), ),
), ),);
),
),
);
} }
_scanQrAndGetPatient(BuildContext context) async { _scanQrAndGetPatient(BuildContext context, PatientViewModel model) async {
/// When give qr we will change this method to get data /// When give qr we will change this method to get data
/// var result = await BarcodeScanner.scan(); /// var result = await BarcodeScanner.scan();
/// int patientID = get from qr result /// int patientID = get from qr result
@ -148,8 +154,8 @@ class _QrReaderScreenState extends State<QrReaderScreen> {
// Provider.of<PatientsProvider>(context, listen: false); // Provider.of<PatientsProvider>(context, listen: false);
patient.PatientID = 8808; patient.PatientID = 8808;
patient.TokenID = token; patient.TokenID = token;
Provider.of<PatientsProvider>(context, listen: false) model
.getPatientList(patient, "1") .getPatientList(patient, "1", isBusyLocal: true)
.then((response) { .then((response) {
if (response['MessageStatus'] == 1) { if (response['MessageStatus'] == 1) {
switch (patientType) { switch (patientType) {

@ -4,10 +4,9 @@ import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/doctor/clinic_model.dart'; import 'package:doctor_app_flutter/models/doctor/clinic_model.dart';
import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart';
import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart';
import 'package:doctor_app_flutter/providers/auth_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/providers/hospital_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
@ -39,8 +38,8 @@ class DashboardScreen extends StatefulWidget {
} }
class _DashboardScreenState extends State<DashboardScreen> { class _DashboardScreenState extends State<DashboardScreen> {
HospitalProvider hospitalProvider; HospitalViewModel hospitalProvider;
AuthProvider authProvider; AuthViewModel authProvider;
bool isLoading = false; bool isLoading = false;
ProjectProvider projectsProvider; ProjectProvider projectsProvider;
var _isInit = true; var _isInit = true;
@ -83,7 +82,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
children: <Widget>[ children: <Widget>[
Container( Container(
height: 140, height: 140,
color: Hexcolor('#515B5D'), color: HexColor('#515B5D'),
width: double.infinity, width: double.infinity,
child: FractionallySizedBox( child: FractionallySizedBox(
widthFactor: 0.9, widthFactor: 0.9,
@ -222,7 +221,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
bottom: 19, bottom: 19,
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor("#DED8CF"), color: HexColor("#DED8CF"),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
@ -250,20 +249,20 @@ class _DashboardScreenState extends State<DashboardScreen> {
AppText("38", AppText("38",
fontSize: fontSize:
SizeConfig.textMultiplier * 3.7, SizeConfig.textMultiplier * 3.7,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold,), fontWeight: FontWeight.bold,),
AppText(TranslationBase AppText(TranslationBase
.of(context) .of(context)
.outPatients, .outPatients,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: SizeConfig.textMultiplier * 1.4, fontSize: SizeConfig.textMultiplier * 1.4,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
), ),
], ],
), ),
circularStrokeCap: CircularStrokeCap.butt, circularStrokeCap: CircularStrokeCap.butt,
backgroundColor: Colors.blueGrey[100], backgroundColor: Colors.blueGrey[100],
progressColor: Hexcolor('#B8382C'), progressColor: HexColor('#B8382C'),
), ),
), ),
Container( Container(
@ -277,7 +276,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide( inside: BorderSide(
width: 0.5, width: 0.5,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
), ),
), ),
children: [ children: [
@ -291,13 +290,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
TranslationBase.of(context).arrived, TranslationBase.of(context).arrived,
fontSize: fontSize:
SizeConfig.textMultiplier * 1.5, SizeConfig.textMultiplier * 1.5,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
), ),
AppText( AppText(
"23", "23",
fontSize: fontSize:
SizeConfig.textMultiplier * 2.7, SizeConfig.textMultiplier * 2.7,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
SizedBox( SizedBox(
@ -313,13 +312,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
TranslationBase.of(context).er, TranslationBase.of(context).er,
fontSize: fontSize:
SizeConfig.textMultiplier * 1.5, SizeConfig.textMultiplier * 1.5,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
), ),
AppText( AppText(
"03", "03",
fontSize: fontSize:
SizeConfig.textMultiplier * 2.7, SizeConfig.textMultiplier * 2.7,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
SizedBox( SizedBox(
@ -342,13 +341,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
TranslationBase.of(context).notArrived, TranslationBase.of(context).notArrived,
fontSize: fontSize:
SizeConfig.textMultiplier * 1.5, SizeConfig.textMultiplier * 1.5,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
), ),
AppText( AppText(
"15", "15",
fontSize: fontSize:
SizeConfig.textMultiplier * 2.7, SizeConfig.textMultiplier * 2.7,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
], ],
@ -364,13 +363,13 @@ class _DashboardScreenState extends State<DashboardScreen> {
TranslationBase.of(context).walkIn, TranslationBase.of(context).walkIn,
fontSize: fontSize:
SizeConfig.textMultiplier * 1.5, SizeConfig.textMultiplier * 1.5,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
), ),
AppText( AppText(
"04", "04",
fontSize: fontSize:
SizeConfig.textMultiplier * 2.7, SizeConfig.textMultiplier * 2.7,
color: Hexcolor('#5D4C35'), color: HexColor('#5D4C35'),
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
], ],
@ -554,7 +553,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
), ),
imageName: '4.png', imageName: '4.png',
color: Hexcolor('#B8382C'), color: HexColor('#B8382C'),
hasBorder: false, hasBorder: false,
width: MediaQuery width: MediaQuery
.of(context) .of(context)
@ -608,7 +607,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
), ),
), ),
imageName: '5.png', imageName: '5.png',
color: Hexcolor('#B8382C'), color: HexColor('#B8382C'),
hasBorder: false, hasBorder: false,
width: MediaQuery width: MediaQuery
.of(context) .of(context)
@ -744,10 +743,7 @@ class _DashboardScreenState extends State<DashboardScreen> {
context, context,
MaterialPageRoute( MaterialPageRoute(
builder: (context) => builder: (context) =>
ChangeNotifierProvider( MedicineSearchScreen(),
create: (_) => MedicineProvider(),
child: MedicineSearchScreen(),
),
), ),
); );
}, },
@ -1015,7 +1011,7 @@ class DashboardItem extends StatelessWidget {
.height * 0.35, .height * 0.35,
decoration: BoxDecoration( decoration: BoxDecoration(
color: !hasBorder ? color != null ? color : Hexcolor('#050705') color: !hasBorder ? color != null ? color : HexColor('#050705')
.withOpacity(opacity) : Colors .withOpacity(opacity) : Colors
.white, .white,
borderRadius: BorderRadius.circular(6.0), borderRadius: BorderRadius.circular(6.0),

@ -7,8 +7,14 @@ import 'package:flutter/material.dart';
import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart';
class MyReferralPatient extends StatelessWidget { class MyReferralPatient extends StatefulWidget {
int expandedItemIndex = -1;
@override
_MyReferralPatientState createState() => _MyReferralPatientState();
}
class _MyReferralPatientState extends State<MyReferralPatient> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<ReferralPatientViewModel>( return BaseView<ReferralPatientViewModel>(
@ -35,12 +41,28 @@ class MyReferralPatient extends StatelessWidget {
), ),
Container( Container(
child: Column( child: Column(
children: model.listMyReferralPatientModel children: [
.map((item) { ...List.generate(
return MyReferralPatientWidget( model.listMyReferralPatientModel.length,
myReferralPatientModel: item, model:model (index) => MyReferralPatientWidget(
); myReferralPatientModel: model
}).toList(), .listMyReferralPatientModel[index],
model: model,
expandClick: () {
setState(() {
if (widget.expandedItemIndex ==
index) {
widget.expandedItemIndex = -1;
} else {
widget.expandedItemIndex = index;
}
});
},
isExpand:
widget.expandedItemIndex == index,
),
)
],
), ),
), ),
], ],

@ -13,8 +13,8 @@ class MyReferredPatient extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<ReferredPatientViewModel>( return BaseView<ReferredPatientViewModel>(
onModelReady: (model) => model.getMyReferredPatient(), onModelReady: (model) => model.getMyReferredPatient(),
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).myReferredPatient, appBarTitle: TranslationBase.of(context).myReferredPatient,
body: model.listMyReferredPatientModel.length == 0 body: model.listMyReferredPatientModel.length == 0
? Center( ? Center(

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/livecare_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/screens/live_care/video_call.dart'; import 'package:doctor_app_flutter/screens/live_care/video_call.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -33,12 +33,12 @@ class _LiveCarePandingListState extends State<LiveCarePandingListScreen> {
List<LiveCarePendingListResponse> _data = []; List<LiveCarePendingListResponse> _data = [];
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
bool _isInit = true; bool _isInit = true;
LiveCareProvider _liveCareProvider; LiveCareViewModel _liveCareProvider;
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
if (_isInit) { if (_isInit) {
_liveCareProvider = Provider.of<LiveCareProvider>(context); _liveCareProvider = Provider.of<LiveCareViewModel>(context);
pendingList(); pendingList();
} }
_isInit = false; _isInit = false;

@ -3,7 +3,7 @@ import 'dart:async';
import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart'; import 'package:doctor_app_flutter/models/livecare/get_pending_res_list.dart';
import 'package:doctor_app_flutter/models/livecare/session_status_model.dart'; import 'package:doctor_app_flutter/models/livecare/session_status_model.dart';
import 'package:doctor_app_flutter/models/livecare/start_call_res.dart'; import 'package:doctor_app_flutter/models/livecare/start_call_res.dart';
import 'package:doctor_app_flutter/providers/livecare_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/livecare_view_model.dart';
import 'package:doctor_app_flutter/screens/live_care/panding_list.dart'; import 'package:doctor_app_flutter/screens/live_care/panding_list.dart';
import 'package:doctor_app_flutter/util/VideoChannel.dart'; import 'package:doctor_app_flutter/util/VideoChannel.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
@ -30,7 +30,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
Timer _timmerInstance; Timer _timmerInstance;
int _start = 0; int _start = 0;
String _timmer = ''; String _timmer = '';
LiveCareProvider _liveCareProvider; LiveCareViewModel _liveCareProvider;
bool _isInit = true; bool _isInit = true;
var _tokenData; var _tokenData;
bool isTransfer = false; bool isTransfer = false;
@ -43,7 +43,7 @@ class _VideoCallPageState extends State<VideoCallPage> {
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
if (_isInit) { if (_isInit) {
_liveCareProvider = Provider.of<LiveCareProvider>(context); _liveCareProvider = Provider.of<LiveCareViewModel>(context);
startCall(false); startCall(false);
} }
_isInit = false; _isInit = false;

@ -2,8 +2,9 @@ import 'dart:math';
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/viewModel/medicine_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/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart'; import 'package:doctor_app_flutter/screens/medicine/pharmacies_list_screen.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
@ -14,10 +15,9 @@ import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.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/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'package:speech_to_text/speech_recognition_result.dart'; import 'package:speech_to_text/speech_recognition_result.dart';
import 'package:speech_to_text/speech_to_text.dart'; import 'package:speech_to_text/speech_to_text.dart';
@ -40,7 +40,6 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
final myController = TextEditingController(); final myController = TextEditingController();
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
bool _hasSpeech = false; bool _hasSpeech = false;
MedicineProvider _medicineProvider;
String _currentLocaleId = ""; String _currentLocaleId = "";
bool _isInit = true; bool _isInit = true;
final SpeechToText speech = SpeechToText(); final SpeechToText speech = SpeechToText();
@ -57,12 +56,6 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
if (_isInit) {
_medicineProvider = Provider.of<MedicineProvider>(context);
// requestPermissions();
// initSpeechState();
}
_isInit = false;
} }
void requestPermissions() async { void requestPermissions() async {
@ -92,7 +85,8 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<MedicineViewModel>(
builder: (_, model, w) => AppScaffold(
appBarTitle: TranslationBase.of(context).searchMedicine, appBarTitle: TranslationBase.of(context).searchMedicine,
body: FractionallySizedBox( body: FractionallySizedBox(
widthFactor: 0.97, widthFactor: 0.97,
@ -140,7 +134,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
controller: myController, controller: myController,
onSaved: (value) {}, onSaved: (value) {},
onFieldSubmitted: (value) { onFieldSubmitted: (value) {
searchMedicine(context); searchMedicine(context, model);
}, },
textInputAction: TextInputAction.search, textInputAction: TextInputAction.search,
// TODO return it back when it needed // TODO return it back when it needed
@ -165,109 +159,115 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
child: Wrap( child: Wrap(
alignment: WrapAlignment.center, alignment: WrapAlignment.center,
children: <Widget>[ children: <Widget>[
// TODO change it secondary button and add loading
AppButton( AppButton(
title: TranslationBase.of(context).search, title: TranslationBase.of(context).search,
onPressed: () { onPressed: () {
searchMedicine(context); searchMedicine(context, model);
}, },
), ),
], ],
), ),
), ),
Container(
margin: EdgeInsets.only( NetworkBaseView(
left: SizeConfig.heightMultiplier * 2), baseViewModel: model,
child: Row( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: <Widget>[ Container(
AppText( margin: EdgeInsets.only(
TranslationBase.of(context).youCanFind + left: SizeConfig.heightMultiplier * 2),
_medicineProvider.pharmacyItemsList.length child: Row(
.toString() + crossAxisAlignment: CrossAxisAlignment.start,
" " + children: <Widget>[
TranslationBase.of(context).itemsInSearch, AppText(
fontWeight: FontWeight.bold, TranslationBase
), .of(context)
], .youCanFind +
), model.pharmacyItemsList.length
), .toString() +
Container( " " +
height: MediaQuery.of(context).size.height * 0.35, TranslationBase
child: Container( .of(context)
child: !_medicineProvider.isFinished .itemsInSearch,
? DrAppCircularProgressIndeicator() fontWeight: FontWeight.bold,
: _medicineProvider.hasError ),
? Center( ],
child: Text( ),
_medicineProvider.errorMsg, ),
style: TextStyle( Container(
color: height: MediaQuery
Theme.of(context).errorColor), .of(context)
), .size
) .height * 0.35,
: ListView.builder( child: Container(
scrollDirection: Axis.vertical, child: ListView.builder(
shrinkWrap: true, scrollDirection: Axis.vertical,
itemCount: shrinkWrap: true,
_medicineProvider.pharmacyItemsList == itemCount:
null model.pharmacyItemsList ==
? 0 null
: _medicineProvider ? 0
.pharmacyItemsList.length, : model
itemBuilder: .pharmacyItemsList.length,
(BuildContext context, int index) { itemBuilder:
return InkWell( (BuildContext context, int index) {
child: MedicineItemWidget( return InkWell(
label: _medicineProvider child: MedicineItemWidget(
.pharmacyItemsList[index] label: model
["ItemDescription"], .pharmacyItemsList[index]
url: _medicineProvider ["ItemDescription"],
.pharmacyItemsList[index] url: model
["ImageSRCUrl"], .pharmacyItemsList[index]
), ["ImageSRCUrl"],
onTap: () { ),
Navigator.push( onTap: () {
context, Navigator.push(
MaterialPageRoute( context,
builder: (context) => MaterialPageRoute(
PharmaciesListScreen( builder: (context) =>
itemID: _medicineProvider PharmaciesListScreen(
itemID: model
.pharmacyItemsList[ .pharmacyItemsList[
index]["ItemID"], index]["ItemID"],
url: _medicineProvider url: model
.pharmacyItemsList[ .pharmacyItemsList[
index]["ImageSRCUrl"]), index]["ImageSRCUrl"]),
), ),
);
},
); );
}, },
); ),
}, ),
), ),
), ],
), )),
], ],
), ),
), ),
], ],
), ),
), ),
)); ),),);
} }
searchMedicine(context) { searchMedicine(context, MedicineViewModel model) {
FocusScope.of(context).unfocus(); FocusScope.of(context).unfocus();
if (myController.text.isNullOrEmpty()) { if (myController.text.isNullOrEmpty()) {
_medicineProvider.clearPharmacyItemsList(); helpers.showErrorToast(TranslationBase
helpers.showErrorToast(TranslationBase.of(context).typeMedicineName) ; .of(context)
.typeMedicineName);
//"Type Medicine Name") //"Type Medicine Name")
return; return;
} }
if (myController.text.length < 3) { if (myController.text.length < 3) {
_medicineProvider.clearPharmacyItemsList(); helpers.showErrorToast(TranslationBase
helpers.showErrorToast(TranslationBase.of(context).moreThan3Letter); .of(context)
.moreThan3Letter);
return; return;
} }
_medicineProvider.getMedicineItem(myController.text); model.getMedicineItem(myController.text);
} }
startVoiceSearch() { startVoiceSearch() {
@ -292,7 +292,7 @@ class _MedicineSearchState extends State<MedicineSearchScreen> {
lastStatus = ''; lastStatus = '';
myController.text = reconizedWord; myController.text = reconizedWord;
Future.delayed(const Duration(seconds: 2), () { Future.delayed(const Duration(seconds: 2), () {
searchMedicine(context); // searchMedicine(context);
}); });
}); });
} }

@ -2,14 +2,14 @@ import 'dart:convert';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
@ -34,7 +34,6 @@ class PharmaciesListScreen extends StatefulWidget {
class _PharmaciesListState extends State<PharmaciesListScreen> { class _PharmaciesListState extends State<PharmaciesListScreen> {
var _data; var _data;
Helpers helpers = new Helpers(); Helpers helpers = new Helpers();
MedicineProvider _medicineProvider;
ProjectProvider projectsProvider; ProjectProvider projectsProvider;
bool _isInit = true; bool _isInit = true;
@ -43,47 +42,38 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
if (_isInit) {
_medicineProvider = Provider.of<MedicineProvider>(context);
pharmaciesList();
}
_isInit = false; _isInit = false;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectsProvider = Provider.of(context); projectsProvider = Provider.of(context);
return AppScaffold( return BaseView<MedicineViewModel>(
onModelReady: (model) => model.getPharmaciesList(widget.itemID),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).pharmaciesList, appBarTitle: TranslationBase.of(context).pharmaciesList,
body: !_medicineProvider.isFinished body: Container(
? DrAppCircularProgressIndeicator()
: _medicineProvider.hasError
? Center(
child: Text(
_medicineProvider.errorMsg,
style: TextStyle(
color: Theme.of(context).errorColor),
),
)
:Container(
height: SizeConfig.screenHeight, height: SizeConfig.screenHeight,
child: ListView( child: ListView(
shrinkWrap: true, shrinkWrap: true,
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
physics: const AlwaysScrollableScrollPhysics(), physics: const AlwaysScrollableScrollPhysics(),
children: <Widget>[ children: <Widget>[
_medicineProvider.pharmaciesList.length >0 ?RoundedContainer( model.pharmaciesList.length > 0
child: Row( ? RoundedContainer(
children: <Widget>[ child: Row(
Expanded( children: <Widget>[
flex: 1, Expanded(
child: ClipRRect( flex: 1,
borderRadius: BorderRadius.all( child: ClipRRect(
Radius.circular(7)), borderRadius:
child: widget.url != null ?Image.network( BorderRadius.all(Radius.circular(7)),
widget.url, child: widget.url != null
height: ? Image.network(
SizeConfig.imageSizeMultiplier * widget.url,
height:
SizeConfig.imageSizeMultiplier *
21, 21,
width: width:
SizeConfig.imageSizeMultiplier * SizeConfig.imageSizeMultiplier *
@ -110,7 +100,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
AppText( AppText(
_medicineProvider.pharmaciesList[0]["ItemDescription"], model.pharmaciesList[0]["ItemDescription"],
marginLeft: 10, marginLeft: 10,
marginTop: 0, marginTop: 0,
marginRight: 10, marginRight: 10,
@ -125,7 +115,7 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
AppText( AppText(
_medicineProvider.pharmaciesList[0]["SellingPrice"] model.pharmaciesList[0]["SellingPrice"]
.toString(), .toString(),
marginLeft: 10, marginLeft: 10,
marginTop: 0, marginTop: 0,
@ -161,7 +151,8 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(), physics: const NeverScrollableScrollPhysics(),
itemCount: _medicineProvider.pharmaciesList == null ? 0 : _medicineProvider.pharmaciesList.length, itemCount: model.pharmaciesList == null ? 0 : model
.pharmaciesList.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return RoundedContainer( return RoundedContainer(
child: Row( child: Row(
@ -170,13 +161,14 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
flex: 1, flex: 1,
child: ClipRRect( child: ClipRRect(
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(7)), BorderRadius.all(Radius.circular(7)),
child: Image.network( child: Image.network(
_medicineProvider.pharmaciesList[index]["ProjectImageURL"], model
.pharmaciesList[index]["ProjectImageURL"],
height: height:
SizeConfig.imageSizeMultiplier * 15, SizeConfig.imageSizeMultiplier * 15,
width: width:
SizeConfig.imageSizeMultiplier * 15, SizeConfig.imageSizeMultiplier * 15,
fit: BoxFit.cover, fit: BoxFit.cover,
), ),
), ),
@ -184,7 +176,8 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
Expanded( Expanded(
flex: 4, flex: 4,
child: AppText( child: AppText(
_medicineProvider.pharmaciesList[index]["LocationDescription"], model
.pharmaciesList[index]["LocationDescription"],
margin: 10, margin: 10,
), ),
), ),
@ -202,8 +195,10 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
Icons.call, Icons.call,
color: Colors.red, color: Colors.red,
), ),
onTap: () => launch("tel://" + onTap: () =>
_medicineProvider.pharmaciesList[index]["PhoneNumber"]), launch("tel://" +
model
.pharmaciesList[index]["PhoneNumber"]),
), ),
), ),
Padding( Padding(
@ -216,11 +211,13 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
onTap: () { onTap: () {
MapsLauncher.launchCoordinates( MapsLauncher.launchCoordinates(
double.parse( double.parse(
_medicineProvider.pharmaciesList[index]["Latitude"]), model
.pharmaciesList[index]["Latitude"]),
double.parse( double.parse(
_medicineProvider.pharmaciesList[index]["Longitude"]), model
_medicineProvider.pharmaciesList[index] .pharmaciesList[index]["Longitude"]),
["LocationDescription"]); model.pharmaciesList[index]
["LocationDescription"]);
}, },
), ),
), ),
@ -233,13 +230,10 @@ class _PharmaciesListState extends State<PharmaciesListScreen> {
}), }),
), ),
) )
]), ]),
)); ),),);
} }
pharmaciesList() async {
_medicineProvider.getPharmaciesList(widget.itemID);
}
Image imageFromBase64String(String base64String) { Image imageFromBase64String(String base64String) {
return Image.memory(base64Decode(base64String)); return Image.memory(base64Decode(base64String));

@ -1,15 +1,13 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart'; import 'package:doctor_app_flutter/models/patient/prescription/prescription_res_model.dart';
import 'package:doctor_app_flutter/models/patient/prescription/request_prescription_report.dart'; import 'package:doctor_app_flutter/models/patient/prescription/request_prescription_report.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart'; import 'package:doctor_app_flutter/screens/patients/profile/prescriptions/out_patient_prescription_details_item.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.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/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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:doctor_app_flutter/util/translations_delegate_base.dart';
class OutPatientPrescriptionDetailsScreen extends StatefulWidget { class OutPatientPrescriptionDetailsScreen extends StatefulWidget {
final PrescriptionResModel prescriptionResModel; final PrescriptionResModel prescriptionResModel;
@ -23,44 +21,33 @@ class OutPatientPrescriptionDetailsScreen extends StatefulWidget {
class _OutPatientPrescriptionDetailsScreenState class _OutPatientPrescriptionDetailsScreenState
extends State<OutPatientPrescriptionDetailsScreen> { extends State<OutPatientPrescriptionDetailsScreen> {
bool _isInit = true;
PatientsProvider patientsProvider;
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProvider = Provider.of<PatientsProvider>(context);
RequestPrescriptionReport prescriptionReqModel = getPrescriptionReport(BuildContext context,PatientViewModel model ){
RequestPrescriptionReport( RequestPrescriptionReport prescriptionReqModel =
appointmentNo: widget.prescriptionResModel.appointmentNo, RequestPrescriptionReport(
episodeID: widget.prescriptionResModel.episodeID, appointmentNo: widget.prescriptionResModel.appointmentNo,
setupID: widget.prescriptionResModel.setupID, episodeID: widget.prescriptionResModel.episodeID,
patientTypeID: widget.prescriptionResModel.patientID); setupID: widget.prescriptionResModel.setupID,
patientsProvider.getPrescriptionReport(prescriptionReqModel.toJson()); patientTypeID: widget.prescriptionResModel.patientID);
} model.getPrescriptionReport(prescriptionReqModel.toJson());
_isInit = false;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<PatientViewModel>(
appBarTitle: TranslationBase.of(context).prescriptionDetails, onModelReady: (model) => getPrescriptionReport(context, model),
body: patientsProvider.isLoading builder: (_, model, w) => AppScaffold(
? DrAppCircularProgressIndeicator() appBarTitle: TranslationBase.of(context).prescriptionDetails,
: patientsProvider.isError body: CardWithBgWidgetNew(
? DrAppEmbeddedError(error: patientsProvider.error)
: CardWithBgWidgetNew(
widget: ListView.builder( widget: ListView.builder(
itemCount: patientsProvider.prescriptionReport.length, itemCount: model.prescriptionReport.length,
itemBuilder: (BuildContext context, int index) { itemBuilder: (BuildContext context, int index) {
return OutPatientPrescriptionDetailsItem( return OutPatientPrescriptionDetailsItem(
prescriptionReport: prescriptionReport:
patientsProvider.prescriptionReport[index], model.prescriptionReport[index],
); );
}), }),
), ),
); ),);
} }
} }

@ -1,7 +1,7 @@
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/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
@ -176,7 +176,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
side: BorderSide( side: BorderSide(
width: 1.0, width: 1.0,
style: BorderStyle.solid, style: BorderStyle.solid,
color: Hexcolor("#CCCCCC")), color: HexColor("#CCCCCC")),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
), ),
@ -255,7 +255,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: AppTextFormField( child: AppTextFormField(
labelText: labelText:
@ -285,7 +285,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: AppTextFormField( child: AppTextFormField(
labelText: labelText:
@ -315,7 +315,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: AppTextFormField( child: AppTextFormField(
labelText: TranslationBase.of(context).lastName, labelText: TranslationBase.of(context).lastName,
@ -340,7 +340,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: AppTextFormField( child: AppTextFormField(
labelText: labelText:
@ -370,7 +370,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: AppTextFormField( child: AppTextFormField(
labelText: labelText:
@ -397,7 +397,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, color: Hexcolor("#CCCCCC"))), width: 1.0, color: HexColor("#CCCCCC"))),
padding: EdgeInsets.only(top: 5), padding: EdgeInsets.only(top: 5),
child: AppTextFormField( child: AppTextFormField(
labelText: labelText:
@ -423,7 +423,7 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
side: BorderSide( side: BorderSide(
width: 1.0, width: 1.0,
style: BorderStyle.solid, style: BorderStyle.solid,
color: Hexcolor("#CCCCCC")), color: HexColor("#CCCCCC")),
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(6.0)), BorderRadius.all(Radius.circular(6.0)),
), ),
@ -505,12 +505,12 @@ class _PatientSearchScreenState extends State<PatientSearchScreen> {
Radius.circular(6.0)), Radius.circular(6.0)),
border: Border.all( border: Border.all(
width: 1.0, width: 1.0,
color: Hexcolor("#CCCCCC"))), color: HexColor("#CCCCCC"))),
height: 25, height: 25,
width: 25, width: 25,
child: Checkbox( child: Checkbox(
value: true, value: true,
checkColor: Hexcolor("#2A930A"), checkColor: HexColor("#2A930A"),
activeColor: Colors.white, activeColor: Colors.white,
onChanged: (bool newValue) {}), onChanged: (bool newValue) {}),
), ),

@ -1,67 +0,0 @@
import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../providers/patients_provider.dart';
class PatientsListScreen extends StatefulWidget {
@override
_PatientsListScreenState createState() => _PatientsListScreenState();
}
class _PatientsListScreenState extends State<PatientsListScreen> {
var _isInit = true;
var _isLoading = true;
var _hasError;
@override
void didChangeDependencies() {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatientModel patient = routeArgs['patientSearchForm'];
print(patient.TokenID+"EEEEEE");
String patientType = routeArgs['selectedType'];
print(patientType);
if (_isInit) {
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
patientsProv.getPatientList(patient, patientType).then((res) {
// print('MessageStatus${res['MessageStatus']}');
print('List_MyInPatient${(res['List_MyInPatient'][0])}');
setState(() {
_isLoading = false;
_hasError = res['ErrorEndUserMessage'];
});
print(res);
}).catchError((error) {
print(error);
});
}
_isInit = false;
super.didChangeDependencies();
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('PatientsListScreen'),
),
body: _isLoading
? Center(
child: CircularProgressIndicator(),
)
: Container(
child: _hasError != null
? Center(
child: Text(
_hasError,
style: TextStyle(color: Theme.of(context).errorColor),
),
)
: Text('EEEEEEEEEEEEEE'),
),
);
}
}
/*
{ProjectID: 15, ClinicID: null, DoctorID: 4709, PatientID: 1288076, DoctorName: SHAZIA MAQSOOD, DoctorNameN: null, FirstName: LAMA, MiddleName: ABDULLAH, LastName: AL-SALOOM, FirstNameN: null, MiddleNameN: null, LastNameN: null, Gender: 2, DateofBirth: /Date(522363600000+0300)/, NationalityID: null, MobileNumber: 0543133371, EmailAddress: Lala_as@hotmail.com, PatientIdentificationNo: 1040451369, PatientType: 1, AdmissionNo: 2020008493, AdmissionDate: /Date(1587589200000+0300)/, RoomID: 119, BedID: 119, NursingStationID: null, Description: null, ClinicDescription: OB-GYNE, ClinicDescriptionN: null, NationalityName: Saudi, NationalityNameN: null, Age: 34 Yr, GenderDescription: Female, NursingStationName: Post Natal Ward A2}
*/

@ -8,13 +8,14 @@
*/ */
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_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/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart';
import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
@ -55,70 +56,15 @@ class _PatientsScreenState extends State<PatientsScreen> {
bool _isInit = true; bool _isInit = true;
String patientType; String patientType;
String patientTypeTitle; String patientTypeTitle;
var _isLoading = false; var _isLoading = true;
bool _isError = true; bool _isError = false;
String error = ""; String error = "";
ProjectProvider projectsProvider; ProjectProvider projectsProvider;
final _controller = TextEditingController(); final _controller = TextEditingController();
PatientModel patient; PatientModel patient;
PatientsProvider patientsProv;
@override
void didChangeDependencies() {
projectsProvider = Provider.of(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
patient = routeArgs['patientSearchForm'];
patientType = routeArgs['selectedType'];
if (!projectsProvider.isArabic)
patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
else
patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)];
print(patientType);
if (_isInit) {
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
setState(() {
_isLoading = true;
_isError = false;
error = "";
});
patientsProv.getPatientList(patient, patientType).then((res) {
setState(() {
_isLoading = false;
if (res['MessageStatus'] == 1) {
int val2 = int.parse(patientType);
lItems = res[SERVICES_PATIANT2[val2]];
parsed = lItems;
responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList;
_isError = false;
} else {
_isError = true;
error = res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
}
});
}).catchError((error) {
print(error);
setState(() {
_isError = true;
_isLoading = false;
this.error = error;
});
});
}
_isInit = false;
super.didChangeDependencies();
}
/* /*
*@author: Amjad Amireh *@author: Amjad Amireh
@ -300,24 +246,74 @@ class _PatientsScreenState extends State<PatientsScreen> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_locations = [ _locations = [
TranslationBase.of(context).all, TranslationBase
TranslationBase.of(context).today, .of(context)
TranslationBase.of(context).tomorrow, .all,
TranslationBase.of(context).nextWeek, TranslationBase
.of(context)
.today,
TranslationBase
.of(context)
.tomorrow,
TranslationBase
.of(context)
.nextWeek,
]; ];
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context); projectsProvider = Provider.of(context);
final routeArgs = ModalRoute
return AppScaffold( .of(context)
appBarTitle: patientTypeTitle, .settings
body: _isLoading .arguments as Map;
? DrAppCircularProgressIndeicator()
: _isError patient = routeArgs['patientSearchForm'];
? DrAppEmbeddedError(error: error)
: lItems == null || lItems.length == 0 patientType = routeArgs['selectedType'];
? DrAppEmbeddedError(
error: TranslationBase.of(context).youDontHaveAnyPatient) if (!projectsProvider.isArabic)
: Container( patientTypeTitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
child: ListView( else
patientTypeTitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)];
return BaseView<PatientViewModel>(
onModelReady: (model) {
// TODO : change all the logic here to make it work with the model and remove future
model.getPatientList(patient, patientType).then((res) {
setState(() {
_isLoading = false;
if (res['MessageStatus'] == 1) {
int val2 = int.parse(patientType);
lItems = res[SERVICES_PATIANT2[val2]];
parsed = lItems;
responseModelList = new ModelResponse.fromJson(parsed).list;
responseModelList2 = responseModelList;
_isError = false;
} else {
_isError = true;
error = res['ErrorEndUserMessage'] ?? res['ErrorMessage'];
}
});
}).catchError((error) {
setState(() {
_isError = true;
_isLoading = false;
this.error = error;
});
});
},
builder: (_, model, w) =>
AppScaffold(
appBarTitle: patientTypeTitle,
body: _isLoading
? DrAppCircularProgressIndeicator()
: _isError
? DrAppEmbeddedError(error: error)
: lItems == null || lItems.length == 0
? DrAppEmbeddedError(
error: TranslationBase
.of(context)
.youDontHaveAnyPatient)
: Container(
child: ListView(
scrollDirection: Axis.vertical, scrollDirection: Axis.vertical,
children: <Widget>[ children: <Widget>[
Container( Container(
@ -529,6 +525,21 @@ class _PatientsScreenState extends State<PatientsScreen> {
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
SizedBox( SizedBox(
width: 3.5, width: 3.5,
), ),
@ -611,6 +622,21 @@ class _PatientsScreenState extends State<PatientsScreen> {
? Row( ? Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[ children: <Widget>[
Container(
height: 15,
width: 60,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: HexColor("#20A169"),
),
child: AppText(
item.startTime,
color: Colors.white,
fontSize: 1.5 * SizeConfig.textMultiplier,
textAlign: TextAlign.center,
fontWeight: FontWeight.bold,
),
),
SizedBox( SizedBox(
width: 3.5, width: 3.5,
), ),
@ -654,17 +680,17 @@ class _PatientsScreenState extends State<PatientsScreen> {
: Center( : Center(
child: DrAppEmbeddedError( child: DrAppEmbeddedError(
error: TranslationBase.of( error: TranslationBase.of(
context) context)
.youDontHaveAnyPatient), .youDontHaveAnyPatient),
), ),
), ),
], ],
), ),
) )
], ],
), ),
), ),
); ),);
} }
InputDecoration buildInputDecoration(BuildContext context, hint) { InputDecoration buildInputDecoration(BuildContext context, hint) {
@ -676,7 +702,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
hintStyle: TextStyle(fontSize: 1.66 * SizeConfig.textMultiplier), hintStyle: TextStyle(fontSize: 1.66 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')), borderSide: BorderSide(color: HexColor('#CCCCCC')),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -716,7 +742,7 @@ class _PatientsScreenState extends State<PatientsScreen> {
topLeft: Radius.circular(9.5), topLeft: Radius.circular(9.5),
bottomLeft: Radius.circular(9.5)), bottomLeft: Radius.circular(9.5)),
color: color:
_isActive ? Hexcolor("#B8382B") : Colors.white, _isActive ? HexColor("#B8382B") : Colors.white,
), ),
child: Center( child: Center(
child: Text( child: Text(
@ -734,7 +760,6 @@ class _PatientsScreenState extends State<PatientsScreen> {
), ),
), ),
onTap: () { onTap: () {
print(_locations.indexOf(item));
filterBooking(item.toString()); filterBooking(item.toString());

@ -1,21 +1,20 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_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/models/patient/insurance_aprovals_request.dart'; import 'package:doctor_app_flutter/models/patient/insurance_aprovals_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../config/shared_pref_kay.dart'; import '../../../config/shared_pref_kay.dart';
import '../../../config/size_config.dart'; import '../../../config/size_config.dart';
import '../../../models/patient/patiant_info_model.dart'; import '../../../models/patient/patiant_info_model.dart';
import '../../../providers/patients_provider.dart';
import '../../../util/dr_app_shared_pref.dart'; import '../../../util/dr_app_shared_pref.dart';
import '../../../widgets/shared/app_scaffold_widget.dart'; import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.dart'; import '../../../widgets/shared/app_texts_widget.dart';
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -33,11 +32,9 @@ class InsuranceApprovalsScreen extends StatefulWidget {
} }
class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> { class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
PatientsProvider patientsProv;
var approvalsList; var approvalsList;
var filteredApprovalsList; var filteredApprovalsList;
final _controller = TextEditingController(); final _controller = TextEditingController();
var _isInit = true;
/* /*
*@author: ibrahim al bitar *@author: ibrahim al bitar
@ -46,7 +43,8 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
*@return: *@return:
*@desc: *@desc:
*/ */
getInsuranceApprovalsList(context) async { getInsuranceApprovalsList(
BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -60,62 +58,58 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2); languageID: 2);
patientsProv model
.getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()).then((c){ .getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()).then((c){
approvalsList = patientsProv.insuranceApporvalsList; approvalsList = model.insuranceApporvalsList;
}); });
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getInsuranceApprovalsList(context);
approvalsList = patientsProv.insuranceApporvalsList;
_isInit = false;
}
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<PatientViewModel>(
appBarTitle: TranslationBase.of(context).insuranceApprovals, onModelReady: (model) => getInsuranceApprovalsList(context, model),
body: patientsProv.isLoading builder: (_, model, w) =>
? DrAppCircularProgressIndeicator() AppScaffold(
: patientsProv.isError baseViewModel: model,
? DrAppEmbeddedError(error: patientsProv.error) appBarTitle: TranslationBase
: patientsProv.insuranceApporvalsList == null || patientsProv.insuranceApporvalsList.length == 0 .of(context)
? DrAppEmbeddedError( .insuranceApprovals,
error: body: model.insuranceApporvalsList == null ||
TranslationBase.of(context).errorNoInsuranceApprovals) model.insuranceApporvalsList.length == 0
: Column( ? DrAppEmbeddedError(
children: <Widget>[ error:
Container( TranslationBase
margin: EdgeInsets.all(10), .of(context)
width: SizeConfig.screenWidth * 0.80, .errorNoInsuranceApprovals)
child: TextField( : Column(
controller: _controller, children: <Widget>[
onChanged: (String str) { Container(
this.searchData(str); margin: EdgeInsets.all(10),
}, width: SizeConfig.screenWidth * 0.80,
textInputAction: TextInputAction.done, child: TextField(
decoration: buildInputDecoration( controller: _controller,
context, onChanged: (String str) {
TranslationBase.of(context) this.searchData(str, model);
.searchInsuranceApprovals), },
), textInputAction: TextInputAction.done,
), decoration: buildInputDecoration(
Expanded( context,
child: Container( TranslationBase
margin: EdgeInsets.fromLTRB( .of(context)
SizeConfig.realScreenWidth * 0.05, .searchInsuranceApprovals),
0, ),
SizeConfig.realScreenWidth * 0.05, ),
0), Expanded(
child: ListView.builder( child: Container(
itemCount: approvalsList.length, margin: EdgeInsets.fromLTRB(
itemBuilder: (BuildContext ctxt, int index) { SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: ListView.builder(
itemCount: approvalsList.length,
itemBuilder: (BuildContext ctxt, int index) {
return RoundedContainer( return RoundedContainer(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
@ -429,13 +423,13 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
], ],
), ),
], ],
)); ));
}), }),
), ),
), ),
], ],
), ),
); ),);
} }
InputDecoration buildInputDecoration(BuildContext context, hint) { InputDecoration buildInputDecoration(BuildContext context, hint) {
@ -447,7 +441,7 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')), borderSide: BorderSide(color: HexColor('#CCCCCC')),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -455,21 +449,21 @@ class _InsuranceApprovalsState extends State<InsuranceApprovalsScreen> {
)); ));
} }
searchData(String str) { searchData(String str, PatientViewModel model) {
var strExist = str.length > 0 ? true : false; var strExist = str.length > 0 ? true : false;
if (strExist) { if (strExist) {
filteredApprovalsList = null; filteredApprovalsList = null;
filteredApprovalsList = approvalsList filteredApprovalsList = approvalsList
.where((note) => .where((note) =>
note["ClinicName"].toString().contains(str.toUpperCase())) note["ClinicName"].toString().contains(str.toUpperCase()))
.toList(); .toList();
setState(() { setState(() {
approvalsList = filteredApprovalsList; approvalsList = filteredApprovalsList;
}); });
} else { } else {
setState(() { setState(() {
approvalsList = patientsProv.insuranceApporvalsList; approvalsList = model.insuranceApporvalsList;
}); });
} }
} }

@ -1,24 +1,20 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart'; import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart'; import '../../../../config/size_config.dart';
import '../../../../models/patient/lab_orders/lab_orders_req_model.dart'; import '../../../../models/patient/lab_orders/lab_orders_req_model.dart';
import '../../../../models/patient/patiant_info_model.dart'; import '../../../../models/patient/patiant_info_model.dart';
import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart'; import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart'; import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/card_with_bg_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/profile_image_widget.dart';
import 'lab_result_secreen.dart'; import 'lab_result_secreen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -36,17 +32,16 @@ class LabOrdersScreen extends StatefulWidget {
} }
class _LabOrdersScreenState extends State<LabOrdersScreen> { class _LabOrdersScreenState extends State<LabOrdersScreen> {
PatientsProvider patientsProv;
var _isInit = true;
/* /*
*@author: Elham Rababah *@author: Elham Rababah
*@Date:28/4/2020 *@Date:28/4/2020
*@param: context *@param: context
*@return: *@return:
*@desc: getVitalSignList Function *@desc: getLabResultOrders Function
*/ */
getLabResultOrders(context) async { getLabResultOrders(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -57,181 +52,184 @@ class _LabOrdersScreenState extends State<LabOrdersScreen> {
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2); languageID: 2);
patientsProv.getLabResultOrders(labOrdersReqModel.toJson()); model.getLabResultOrders(labOrdersReqModel.toJson());
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getLabResultOrders(context);
}
_isInit = false;
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<PatientViewModel>(
appBarTitle: TranslationBase.of(context).labOrders, onModelReady: (model) => getLabResultOrders(context, model),
body: patientsProv.isLoading builder: (_, model, w) =>
? DrAppCircularProgressIndeicator() AppScaffold(
: patientsProv.isError baseViewModel: model,
? DrAppEmbeddedError(error: patientsProv.error) appBarTitle: TranslationBase
: patientsProv.patientLabResultOrdersList.length == 0 .of(context)
? DrAppEmbeddedError( .labOrders,
error: TranslationBase.of(context).errorNoLabOrders) body: model.patientLabResultOrdersList.length == 0
: Container( ? DrAppEmbeddedError(
margin: EdgeInsets.fromLTRB( error: TranslationBase
SizeConfig.realScreenWidth * 0.05, .of(context)
0, .errorNoLabOrders)
SizeConfig.realScreenWidth * 0.05, : Container(
0), margin: EdgeInsets.fromLTRB(
child: Container( SizeConfig.realScreenWidth * 0.05,
margin: EdgeInsets.symmetric(vertical: 10), 0,
decoration: BoxDecoration( SizeConfig.realScreenWidth * 0.05,
color: Colors.white, 0),
borderRadius: BorderRadius.all( child: Container(
Radius.circular(20.0), margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),
),
child: ListView.builder(
itemCount:
model.patientLabResultOrdersList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
LabResult(
labOrders: model
.patientLabResultOrdersList[index],
),
),
);
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
border: Border(
bottom: BorderSide(
color: Colors.grey, width: 0.5),
top: BorderSide(
color: Colors.grey, width: 0.5),
left: BorderSide(
color: Colors.grey, width: 0.5),
right: BorderSide(
color: Colors.grey, width: 0.5),
),
), ),
), child: Column(
child: ListView.builder( crossAxisAlignment:
itemCount: CrossAxisAlignment.start,
patientsProv.patientLabResultOrdersList.length, children: <Widget>[
itemBuilder: (BuildContext context, int index) { Row(
return InkWell( children: <Widget>[
onTap: () { LargeAvatar(
Navigator.push( url: model
context, .patientLabResultOrdersList[
MaterialPageRoute( index]
builder: (context) => LabResult( .doctorImageURL,
labOrders: patientsProv name: model
.patientLabResultOrdersList[index], .patientLabResultOrdersList[
), index]
), .doctorName,
);
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
border: Border(
bottom: BorderSide(
color: Colors.grey, width: 0.5),
top: BorderSide(
color: Colors.grey, width: 0.5),
left: BorderSide(
color: Colors.grey, width: 0.5),
right: BorderSide(
color: Colors.grey, width: 0.5),
),
), ),
child: Column( Expanded(
crossAxisAlignment: child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[ children: <Widget>[
LargeAvatar( AppText(
url: patientsProv '${model
.patientLabResultOrdersList[ .patientLabResultOrdersList[index]
index] .doctorName}',
.doctorImageURL, fontSize: 1.7 *
name: patientsProv SizeConfig
.patientLabResultOrdersList[ .textMultiplier,
index] fontWeight: FontWeight.w600,
.doctorName,
), ),
Expanded( SizedBox(
child: Padding( height: 8,
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${patientsProv.patientLabResultOrdersList[index].doctorName}',
fontSize: 1.7 *
SizeConfig
.textMultiplier,
fontWeight: FontWeight.w600,
),
SizedBox(
height: 8,
),
AppText(
' ${patientsProv.patientLabResultOrdersList[index].projectName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800]),
SizedBox(
height: 8,
),
Row(
mainAxisAlignment:
MainAxisAlignment.start,
children: <Widget>[
AppText(
' Invoice No :',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${patientsProv.patientLabResultOrdersList[index].invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
],
)
],
),
),
)
],
),
SizedBox(
height: 3,
),
Divider(
color: Colors.grey,
),
SizedBox(
height: 3,
),
Row(
children: <Widget>[
Icon(
EvaIcons.calendar,
color: Colors.grey[700],
), ),
AppText(
' ${model
.patientLabResultOrdersList[index]
.projectName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800]),
SizedBox( SizedBox(
width: 10, height: 8,
), ),
Expanded( Row(
child: AppText( mainAxisAlignment:
'${Helpers.getDate(patientsProv.patientLabResultOrdersList[index].createdOn)}', MainAxisAlignment.start,
fontSize: 2.0 * children: <Widget>[
SizeConfig.textMultiplier, AppText(
), ' Invoice No :',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
AppText(
' ${model
.patientLabResultOrdersList[index]
.invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Colors.grey[800],
),
],
) )
], ],
) ),
], ),
)
],
),
SizedBox(
height: 3,
),
Divider(
color: Colors.grey,
),
SizedBox(
height: 3,
),
Row(
children: <Widget>[
Icon(
EvaIcons.calendar,
color: Colors.grey[700],
),
SizedBox(
width: 10,
), ),
), Expanded(
); child: AppText(
}), '${Helpers.getDate(model
), .patientLabResultOrdersList[index]
), .createdOn)}',
); fontSize: 2.0 *
SizeConfig.textMultiplier,
),
)
],
)
],
),
),
);
}),
),
),
),);
} }
} }

@ -1,18 +1,15 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart'; import 'package:doctor_app_flutter/models/patient/lab_orders/lab_orders_res_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/doctor/lab_result_widget.dart'; import 'package:doctor_app_flutter/widgets/doctor/lab_result_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.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 'package:provider/provider.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
class LabResult extends StatefulWidget { class LabResult extends StatefulWidget {
final LabOrdersResModel labOrders; final LabOrdersResModel labOrders;
@ -24,63 +21,46 @@ class LabResult extends StatefulWidget {
} }
class _LabResultState extends State<LabResult> { class _LabResultState extends State<LabResult> {
PatientsProvider patientsProv;
bool _isInit = true;
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
patientsProv.getLabResult(widget.labOrders);
// getLabResultOrders(context);
}
_isInit = false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<PatientViewModel>(
appBarTitle: TranslationBase.of(context).labOrders, onModelReady: (model) => model.getLabResult(widget.labOrders),
body: patientsProv.isLoading builder: (_, model, w) => AppScaffold(
? DrAppCircularProgressIndeicator() baseViewModel: model,
: patientsProv.isError appBarTitle: TranslationBase.of(context).labOrders,
? DrAppEmbeddedError(error: patientsProv.error) body: model.labResultList.length == 0
: patientsProv.labResultList.length == 0 ? DrAppEmbeddedError(
? DrAppEmbeddedError( error: TranslationBase.of(context).errorNoLabOrders)
error: TranslationBase.of(context).errorNoLabOrders) : Container(
: Container( margin: EdgeInsets.fromLTRB(SizeConfig.realScreenWidth * 0.05,
margin: EdgeInsets.fromLTRB( 0, SizeConfig.realScreenWidth * 0.05, 0),
SizeConfig.realScreenWidth * 0.05, child: ListView(
0, children: <Widget>[
SizeConfig.realScreenWidth * 0.05, CardWithBgWidgetNew(
0), widget: Row(
child: ListView( mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[ children: <Widget>[
CardWithBgWidgetNew( AppText(
widget: Row( TranslationBase.of(context).invoiceNo,
mainAxisAlignment: MainAxisAlignment.start, fontSize: 2 * SizeConfig.textMultiplier,
children: <Widget>[ color: Colors.grey[800],
AppText( ),
TranslationBase.of(context).invoiceNo, AppText(
fontSize: 2 * SizeConfig.textMultiplier, ' ${widget.labOrders.invoiceNo}',
color: Colors.grey[800], fontSize: 2 * SizeConfig.textMultiplier,
), color: Colors.grey[800],
AppText(
' ${widget.labOrders.invoiceNo}',
fontSize: 2 * SizeConfig.textMultiplier,
color: Colors.grey[800],
),
],
),
), ),
CardWithBgWidgetNew(
widget: LabResultWidget(
labResult: patientsProv.labResultList,
))
], ],
), ),
), ),
CardWithBgWidgetNew(
widget: LabResultWidget(
labResult: model.labResultList,
))
],
),
),
),
); );
} }
} }

@ -1,20 +1,18 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../config/shared_pref_kay.dart'; import '../../../config/shared_pref_kay.dart';
import '../../../config/size_config.dart'; import '../../../config/size_config.dart';
import '../../../models/patient/patiant_info_model.dart'; import '../../../models/patient/patiant_info_model.dart';
import '../../../providers/patients_provider.dart';
import '../../../util/dr_app_shared_pref.dart'; import '../../../util/dr_app_shared_pref.dart';
import '../../../widgets/shared/app_scaffold_widget.dart'; import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.dart'; import '../../../widgets/shared/app_texts_widget.dart';
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -32,7 +30,6 @@ class PatientsOrdersScreen extends StatefulWidget {
} }
class _PatientsOrdersState extends State<PatientsOrdersScreen> { class _PatientsOrdersState extends State<PatientsOrdersScreen> {
PatientsProvider patientsProv;
var notesList; var notesList;
var filteredNotesList; var filteredNotesList;
final _controller = TextEditingController(); final _controller = TextEditingController();
@ -45,7 +42,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
*@return: *@return:
*@desc: *@desc:
*/ */
getProgressNoteList(context) async { getProgressNoteList(BuildContext context, PatientViewModel model ) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -59,31 +56,20 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2); languageID: 2);
patientsProv.getPatientProgressNote(progressNoteRequest.toJson()).then((c){ model.getPatientProgressNote(progressNoteRequest.toJson()).then((c){
notesList = patientsProv.patientProgressNoteList; notesList = model.patientProgressNoteList;
}); });
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getProgressNoteList(context);
notesList = patientsProv.patientProgressNoteList;
}
_isInit = false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<PatientViewModel>(
appBarTitle: TranslationBase.of(context).orders, onModelReady: (model) => getProgressNoteList(context, model),
body: patientsProv.isLoading builder: (_, model, w) => AppScaffold(
? DrAppCircularProgressIndeicator() baseViewModel: model,
: patientsProv.isError appBarTitle: TranslationBase.of(context).orders,
? DrAppEmbeddedError(error: patientsProv.error) body: notesList == null || notesList.length == 0
: notesList == null || notesList.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: TranslationBase.of(context).errorNoOrders) error: TranslationBase.of(context).errorNoOrders)
: Column( : Column(
@ -94,7 +80,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
child: TextField( child: TextField(
controller: _controller, controller: _controller,
onChanged: (String str) { onChanged: (String str) {
this.searchData(str); this.searchData(str, model);
}, },
textInputAction: TextInputAction.done, textInputAction: TextInputAction.done,
decoration: buildInputDecoration(context, decoration: buildInputDecoration(context,
@ -162,7 +148,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
), ),
], ],
), ),
); ),);
} }
InputDecoration buildInputDecoration(BuildContext context, hint) { InputDecoration buildInputDecoration(BuildContext context, hint) {
@ -174,7 +160,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)), borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')), borderSide: BorderSide(color: HexColor('#CCCCCC')),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(50.0)), borderRadius: BorderRadius.all(Radius.circular(50.0)),
@ -182,7 +168,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
)); ));
} }
searchData(String str) { searchData(String str, PatientViewModel model) {
var strExist = str.length > 0 ? true : false; var strExist = str.length > 0 ? true : false;
if (strExist) { if (strExist) {
@ -196,7 +182,7 @@ class _PatientsOrdersState extends State<PatientsOrdersScreen> {
}); });
} else { } else {
setState(() { setState(() {
notesList = patientsProv.patientProgressNoteList; notesList = model.patientProgressNoteList;
}); });
} }
} }

@ -1,23 +1,17 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/reauest_prescription_report_for_in_patient.dart'; import 'package:doctor_app_flutter/models/patient/reauest_prescription_report_for_in_patient.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/prescription_in_patinets_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/prescription_in_patinets_widget.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/prescription_out_patinets_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/prescription_out_patinets_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.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 '../../../../config/shared_pref_kay.dart'; import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart'; import '../../../../models/patient/patiant_info_model.dart';
import '../../../../models/patient/prescription/prescription_req_model.dart'; import '../../../../models/patient/prescription/prescription_req_model.dart';
import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart'; import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -35,8 +29,6 @@ class PrescriptionScreen extends StatefulWidget {
} }
class _PrescriptionScreenState extends State<PrescriptionScreen> { class _PrescriptionScreenState extends State<PrescriptionScreen> {
PatientsProvider patientsProv;
bool _isInit = true;
String type = '2'; String type = '2';
/* /*
@ -46,7 +38,7 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
*@return: *@return:
*@desc: getPrescriptionsList Function *@desc: getPrescriptionsList Function
*/ */
getPrescriptionsList(context) async { getPrescriptionsList(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -58,7 +50,7 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
patientID: patient.patientId, patientID: patient.patientId,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
admissionNo: int.parse(patient.admissionNo)); admissionNo: int.parse(patient.admissionNo));
patientsProv.getInPatientPrescriptions(prescriptionReqModel.toJson()); model.getInPatientPrescriptions(prescriptionReqModel.toJson());
} else { } else {
PrescriptionReqModel prescriptionReqModel = PrescriptionReqModel( PrescriptionReqModel prescriptionReqModel = PrescriptionReqModel(
patientID: patient.patientId, patientID: patient.patientId,
@ -67,37 +59,30 @@ class _PrescriptionScreenState extends State<PrescriptionScreen> {
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2, languageID: 2,
setupID: 0); setupID: 0);
patientsProv.getOutPatientPrescriptions(prescriptionReqModel.toJson()); model.getOutPatientPrescriptions(prescriptionReqModel.toJson());
} }
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getPrescriptionsList(context);
}
_isInit = false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<PatientViewModel>(
appBarTitle: TranslationBase.of(context).prescription, onModelReady: (model) => getPrescriptionsList(context, model),
body: patientsProv.isLoading builder: (_, model, w) =>
? DrAppCircularProgressIndeicator() AppScaffold(
: patientsProv.isError baseViewModel: model,
? DrAppEmbeddedError(error: patientsProv.error) appBarTitle: TranslationBase
: type == '1' .of(context)
? PrescriptionInPatientWidget( .prescription,
prescriptionReportForInPatientList: body: type == '1'
patientsProv.prescriptionReportForInPatientList, ? PrescriptionInPatientWidget(
) prescriptionReportForInPatientList:
: PrescriptionOutPatientWidget( model.prescriptionReportForInPatientList,
patientPrescriptionsList: )
patientsProv.patientPrescriptionsList, : PrescriptionOutPatientWidget(
), patientPrescriptionsList:
); model.patientPrescriptionsList,
),
),);
} }
} }

@ -1,20 +1,18 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/progress_note_request.dart'; import 'package:doctor_app_flutter/models/patient/progress_note_request.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
import '../../../config/shared_pref_kay.dart'; import '../../../config/shared_pref_kay.dart';
import '../../../config/size_config.dart'; import '../../../config/size_config.dart';
import '../../../models/patient/patiant_info_model.dart'; import '../../../models/patient/patiant_info_model.dart';
import '../../../providers/patients_provider.dart';
import '../../../util/dr_app_shared_pref.dart'; import '../../../util/dr_app_shared_pref.dart';
import '../../../widgets/shared/app_scaffold_widget.dart'; import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.dart'; import '../../../widgets/shared/app_texts_widget.dart';
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -32,7 +30,6 @@ class ProgressNoteScreen extends StatefulWidget {
} }
class _ProgressNoteState extends State<ProgressNoteScreen> { class _ProgressNoteState extends State<ProgressNoteScreen> {
PatientsProvider patientsProv;
var notesList; var notesList;
var filteredNotesList; var filteredNotesList;
final _controller = TextEditingController(); final _controller = TextEditingController();
@ -45,7 +42,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
*@return: *@return:
*@desc: *@desc:
*/ */
getProgressNoteList(context) async { getProgressNoteList(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -53,51 +50,46 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
print(type); print(type);
ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( ProgressNoteRequest progressNoteRequest = ProgressNoteRequest(
visitType: 5, // if equal 5 then this will return progress note visitType: 5,
// if equal 5 then this will return progress note
admissionNo: int.parse(patient.admissionNo), admissionNo: int.parse(patient.admissionNo),
projectID: patient.projectId, projectID: patient.projectId,
tokenID: token, tokenID: token,
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2); languageID: 2);
patientsProv.getPatientProgressNote(progressNoteRequest.toJson()).then((c){ model.getPatientProgressNote(progressNoteRequest.toJson()).then((c) {
notesList = patientsProv.patientProgressNoteList; notesList = model.patientProgressNoteList;
}); });
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getProgressNoteList(context);
notesList = patientsProv.patientProgressNoteList;
}
_isInit = false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<PatientViewModel>(
appBarTitle: TranslationBase.of(context).progressNote, onModelReady: (model) => getProgressNoteList(context, model),
body: patientsProv.isLoading builder: (_, model, w) =>
? DrAppCircularProgressIndeicator() AppScaffold(
: patientsProv.isError baseViewModel: model,
? DrAppEmbeddedError(error: patientsProv.error) appBarTitle: TranslationBase
: notesList == null || notesList.length == 0 .of(context)
? DrAppEmbeddedError( .progressNote,
error: TranslationBase.of(context).errorNoProgressNote) body: notesList == null || notesList.length == 0
: Column( ? DrAppEmbeddedError(
children: <Widget>[ error: TranslationBase
Container( .of(context)
margin: EdgeInsets.all(10), .errorNoProgressNote)
width: SizeConfig.screenWidth * 0.80, : Column(
child: TextField( children: <Widget>[
controller: _controller, Container(
onChanged: (String str) { margin: EdgeInsets.all(10),
this.searchData(str); width: SizeConfig.screenWidth * 0.80,
}, child: TextField(
textInputAction: TextInputAction.done, controller: _controller,
decoration: buildInputDecoration(context, onChanged: (String str) {
this.searchData(str, model);
},
textInputAction: TextInputAction.done,
decoration: buildInputDecoration(context,
TranslationBase.of(context).searchNote), TranslationBase.of(context).searchNote),
), ),
), ),
@ -160,9 +152,9 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
}), }),
), ),
), ),
], ],
), ),
); ),);
} }
InputDecoration buildInputDecoration(BuildContext context, hint) { InputDecoration buildInputDecoration(BuildContext context, hint) {
@ -174,7 +166,7 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10)), borderRadius: BorderRadius.all(Radius.circular(10)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')), borderSide: BorderSide(color: HexColor('#CCCCCC')),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -182,21 +174,21 @@ class _ProgressNoteState extends State<ProgressNoteScreen> {
)); ));
} }
searchData(String str) { searchData(String str, PatientViewModel model) {
var strExist = str.length > 0 ? true : false; var strExist = str.length > 0 ? true : false;
if (strExist) { if (strExist) {
filteredNotesList = null; filteredNotesList = null;
filteredNotesList = patientsProv.patientProgressNoteList filteredNotesList = model.patientProgressNoteList
.where((note) => .where((note) =>
note["DoctorName"].toString().contains(str.toUpperCase())) note["DoctorName"].toString().contains(str.toUpperCase()))
.toList(); .toList();
setState(() { setState(() {
notesList = filteredNotesList; notesList = filteredNotesList;
}); });
} else { } else {
setState(() { setState(() {
notesList = patientsProv.patientProgressNoteList; notesList = model.patientProgressNoteList;
}); });
} }
} }

@ -1,19 +1,18 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/radiology/radiology_req_model.dart'; import 'package:doctor_app_flutter/models/patient/radiology/radiology_req_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_report_screen.dart'; import 'package:doctor_app_flutter/screens/patients/profile/radiology/radiology_report_screen.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart'; import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart'; import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart'; import '../../../../models/patient/patiant_info_model.dart';
import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart'; import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart'; import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -31,8 +30,6 @@ class RadiologyScreen extends StatefulWidget {
} }
class _RadiologyScreenState extends State<RadiologyScreen> { class _RadiologyScreenState extends State<RadiologyScreen> {
PatientsProvider patientsProv;
var _isInit = true;
/* /*
*@author: Elham Rababah *@author: Elham Rababah
@ -41,7 +38,7 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
*@return: *@return:
*@desc: getRadiologyList Function *@desc: getRadiologyList Function
*/ */
getRadiologyList(context) async { getRadiologyList(context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -58,140 +55,136 @@ class _RadiologyScreenState extends State<RadiologyScreen> {
patientTypeID: patient.patientType, patientTypeID: patient.patientType,
languageID: 2, languageID: 2,
); );
patientsProv.getPatientRadiology(radiologyReqModel.toJson()); model.getPatientRadiology(radiologyReqModel.toJson());
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getRadiologyList(context);
}
_isInit = false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<PatientViewModel>(
appBarTitle: TranslationBase.of(context).radiology, onModelReady: (model) => getRadiologyList(context, model),
body: patientsProv.isLoading builder: (_, model, w) =>
? DrAppCircularProgressIndeicator() AppScaffold(
: patientsProv.isError baseViewModel: model,
? DrAppEmbeddedError(error: patientsProv.error) appBarTitle: TranslationBase
: patientsProv.patientRadiologyList.length == 0 .of(context)
? DrAppEmbeddedError( .radiology,
error: TranslationBase.of(context).youDoNotHaveAnyItem) body:
: Container( model.patientRadiologyList.length == 0
margin: EdgeInsets.fromLTRB( ? DrAppEmbeddedError(
SizeConfig.realScreenWidth * 0.05, error: TranslationBase
0, .of(context)
SizeConfig.realScreenWidth * 0.05, .youDoNotHaveAnyItem)
0), : Container(
child: Container( margin: EdgeInsets.fromLTRB(
margin: EdgeInsets.symmetric(vertical: 10), SizeConfig.realScreenWidth * 0.05,
decoration: BoxDecoration( 0,
color: Colors.white, SizeConfig.realScreenWidth * 0.05,
borderRadius: BorderRadius.all( 0),
Radius.circular(20.0), child: Container(
margin: EdgeInsets.symmetric(vertical: 10),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(20.0),
),
),
child: ListView.builder(
itemCount: model.patientRadiologyList.length,
itemBuilder: (BuildContext context, int index) {
return InkWell(
onTap: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
RadiologyReportScreen(
reportData: model
.patientRadiologyList[index]
.reportData,
)),
);
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
border: Border(
bottom: BorderSide(
color: Colors.grey, width: 0.5),
top: BorderSide(
color: Colors.grey, width: 0.5),
left: BorderSide(
color: Colors.grey, width: 0.5),
right: BorderSide(
color: Colors.grey, width: 0.5),
),
), ),
), child: Column(
child: ListView.builder( crossAxisAlignment:
itemCount: patientsProv.patientRadiologyList.length, CrossAxisAlignment.start,
itemBuilder: (BuildContext context, int index) { children: <Widget>[
return InkWell( Row(
onTap: () { children: <Widget>[
Navigator.push( LargeAvatar(
context, url: model
MaterialPageRoute( .patientRadiologyList[index]
builder: (context) => .doctorImageURL,
RadiologyReportScreen(
reportData: patientsProv
.patientRadiologyList[index]
.reportData,
)),
);
},
child: Container(
padding: EdgeInsets.all(10),
margin: EdgeInsets.all(10),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10)),
border: Border(
bottom: BorderSide(
color: Colors.grey, width: 0.5),
top: BorderSide(
color: Colors.grey, width: 0.5),
left: BorderSide(
color: Colors.grey, width: 0.5),
right: BorderSide(
color: Colors.grey, width: 0.5),
),
), ),
child: Column( Expanded(
crossAxisAlignment: child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[ children: <Widget>[
LargeAvatar( AppText(
url: patientsProv '${model.patientRadiologyList[index].doctorName}',
.patientRadiologyList[index] fontSize: 2.5 *
.doctorImageURL, SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold),
SizedBox(
height: 8,
),
AppText(
'Invoice No:${model.patientRadiologyList[index].invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
' ${model.patientRadiologyList[index].clinicName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Theme.of(context)
.primaryColor,
),
SizedBox(
height: 8,
), ),
Expanded(
child: Padding(
padding:
const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${patientsProv.patientRadiologyList[index].doctorName}',
fontSize: 2.5 *
SizeConfig
.textMultiplier,
fontWeight:
FontWeight.bold),
SizedBox(
height: 8,
),
AppText(
'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}',
fontSize: 2 *
SizeConfig
.textMultiplier,
),
SizedBox(
height: 8,
),
AppText(
' ${patientsProv.patientRadiologyList[index].clinicName}',
fontSize: 2 *
SizeConfig
.textMultiplier,
color: Theme.of(context)
.primaryColor,
),
SizedBox(
height: 8,
),
],
),
),
)
], ],
), ),
], ),
), )
), ],
); ),
}), ],
), ),
), ),
); );
}),
),
),
),);
} }
} }

@ -1,22 +1,22 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/scheduler.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import '../../../config/size_config.dart'; import '../../../config/size_config.dart';
import '../../../providers/patients_provider.dart';
import '../../../util/dr_app_shared_pref.dart'; import '../../../util/dr_app_shared_pref.dart';
import '../../../util/extenstions.dart';
import '../../../widgets/shared/app_scaffold_widget.dart'; import '../../../widgets/shared/app_scaffold_widget.dart';
import '../../../widgets/shared/app_texts_widget.dart'; import '../../../widgets/shared/app_texts_widget.dart';
import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../util/extenstions.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -34,7 +34,6 @@ class ReferPatientScreen extends StatefulWidget {
} }
class _ReferPatientState extends State<ReferPatientScreen> { class _ReferPatientState extends State<ReferPatientScreen> {
PatientsProvider patientsProv;
var doctorsList; var doctorsList;
final _remarksController = TextEditingController(); final _remarksController = TextEditingController();
final _extController = TextEditingController(); final _extController = TextEditingController();
@ -51,46 +50,32 @@ class _ReferPatientState extends State<ReferPatientScreen> {
int _activePriority = 1; int _activePriority = 1;
FocusNode myFocusNode; FocusNode myFocusNode = FocusNode();
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
myFocusNode = FocusNode();
doctorsList = null;
patientsProv = Provider.of<PatientsProvider>(context);
patientsProv.getClinicsList();
patientsProv.getReferralFrequancyList();
}
_isInit = false;
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return AppScaffold( return BaseView<PatientViewModel>(
appBarTitle: TranslationBase.of(context).referralPatient, onModelReady: (model) => model.getClinicsList(),
body: patientsProv.isLoading builder: (_, model, w) => AppScaffold(
? DrAppCircularProgressIndeicator() baseViewModel: model,
: patientsProv.isError appBarTitle: TranslationBase.of(context).referralPatient,
? DrAppEmbeddedError(error: patientsProv.error) body: model.clinicsList == null
: patientsProv.clinicsList == null ? DrAppEmbeddedError(error: 'Something Wrong!')
? DrAppEmbeddedError(error: 'Something Wrong!') : SingleChildScrollView(
: SingleChildScrollView( child: Column(
child: Column( mainAxisAlignment: MainAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ AppText(
AppText( TranslationBase.of(context).clinic,
TranslationBase.of(context).clinic, fontSize: 18,
fontSize: 18, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, marginLeft: 15,
marginLeft: 15, marginTop: 15,
marginTop: 15, ),
), RoundedContainer(
RoundedContainer( margin: 10,
margin: 10, showBorder: true,
showBorder: true,
raduis: 10, raduis: 10,
borderColor: Color(0xff707070), borderColor: Color(0xff707070),
width: double.infinity, width: double.infinity,
@ -106,14 +91,13 @@ class _ReferPatientState extends State<ReferPatientScreen> {
Expanded( Expanded(
// add Expanded to have your dropdown button fill remaining space // add Expanded to have your dropdown button fill remaining space
child: DropdownButton( child: DropdownButton(
//hint: Text('Select Clinnic'),
isExpanded: true, isExpanded: true,
value: _selectedClinic, value: _selectedClinic,
iconSize: 40, iconSize: 40,
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder:
(BuildContext context) { (BuildContext context) {
return patientsProv return model
.getClinicNameList() .getClinicNameList()
.map((item) { .map((item) {
return Row( return Row(
@ -133,7 +117,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
setState(() { setState(() {
_selectedDoctor = null; _selectedDoctor = null;
_selectedClinic = newValue; _selectedClinic = newValue;
var clinicInfo = patientsProv var clinicInfo = model
.clinicsList .clinicsList
.where((i) => .where((i) =>
i['ClinicDescription'] i['ClinicDescription']
@ -145,10 +129,10 @@ class _ReferPatientState extends State<ReferPatientScreen> {
clinicId = clinicInfo[0]['ClinicID'] clinicId = clinicInfo[0]['ClinicID']
.toString(); .toString();
patientsProv.getDoctorsList(clinicId); model.getDoctorsList(clinicId);
}) })
}, },
items: patientsProv items: model
.getClinicNameList() .getClinicNameList()
.map((item) { .map((item) {
return DropdownMenuItem( return DropdownMenuItem(
@ -198,43 +182,27 @@ class _ReferPatientState extends State<ReferPatientScreen> {
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder:
(BuildContext context) { (BuildContext context) {
return _selectedDoctor == '' return model
? [ .getDoctorNameList()
Row( .map((item) {
mainAxisSize: return Row(
MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
AppText( AppText(
"eeeee", item,
fontSize: SizeConfig fontSize:
.textMultiplier * SizeConfig.textMultiplier *
2.1, 2.1,
), ),
], ],
) );
] }).toList();
: patientsProv
.getDoctorNameList()
.map((item) {
return Row(
mainAxisSize:
MainAxisSize.max,
children: <Widget>[
AppText(
item,
fontSize: SizeConfig
.textMultiplier *
2.1,
),
],
);
}).toList();
}, },
onChanged: (newValue) => { onChanged: (newValue) => {
setState(() { setState(() {
_selectedDoctor = newValue; _selectedDoctor = newValue;
doctorsList = doctorsList =
patientsProv.doctorsList; model.doctorsList;
var doctorInfo = doctorsList var doctorInfo = doctorsList
.where((i) => i['DoctorName'] .where((i) => i['DoctorName']
@ -245,7 +213,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
.toString(); .toString();
}) })
}, },
items: patientsProv items: model
.getDoctorNameList() .getDoctorNameList()
.map((item) { .map((item) {
return DropdownMenuItem( return DropdownMenuItem(
@ -279,6 +247,13 @@ class _ReferPatientState extends State<ReferPatientScreen> {
onChanged: (value) => {}, onChanged: (value) => {},
), ),
), ),
AppText(
TranslationBase.of(context).priority,
fontSize: 18,
fontWeight: FontWeight.bold,
marginLeft: 15,
marginTop: 15,
),
priorityBar(context), priorityBar(context),
@ -321,7 +296,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
elevation: 16, elevation: 16,
selectedItemBuilder: selectedItemBuilder:
(BuildContext context) { (BuildContext context) {
return patientsProv return model
.getReferralNamesList() .getReferralNamesList()
.map((item) { .map((item) {
return Row( return Row(
@ -340,7 +315,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
onChanged: (newValue) => { onChanged: (newValue) => {
setState(() { setState(() {
_selectedReferralFrequancy = newValue; _selectedReferralFrequancy = newValue;
var freqInfo = patientsProv var freqInfo = model
.referalFrequancyList .referalFrequancyList
.singleWhere((i) => i[ .singleWhere((i) => i[
'Description'] 'Description']
@ -352,7 +327,7 @@ class _ReferPatientState extends State<ReferPatientScreen> {
myFocusNode.requestFocus(); myFocusNode.requestFocus();
}) })
}, },
items: patientsProv items: model
.getReferralNamesList() .getReferralNamesList()
.map((item) { .map((item) {
return DropdownMenuItem( return DropdownMenuItem(
@ -399,17 +374,26 @@ class _ReferPatientState extends State<ReferPatientScreen> {
visibility: visibility:
isValid == null ? false : !isValid, isValid == null ? false : !isValid,
), ),
// TODO replace AppButton with secondary button and add loading
AppButton( AppButton(
title: TranslationBase
.of(context)
.send,
color: Color(PRIMARY_COLOR),
onPressed: () =>
{
referToDoctor(context, model)
},
title: TranslationBase.of(context).send, title: TranslationBase.of(context).send,
color: (Hexcolor("#B8382B")), color: (Hexcolor("#B8382B")),
onPressed: () => {referToDoctor(context)}, onPressed: () => {referToDoctor(context)},
) )
], ],
)) ))
], ],
), ),
), ),
); ),);
} }
Widget priorityBar(BuildContext _context) { Widget priorityBar(BuildContext _context) {
@ -418,49 +402,39 @@ class _ReferPatientState extends State<ReferPatientScreen> {
TranslationBase.of(context).urgent.toUpperCase(), TranslationBase.of(context).urgent.toUpperCase(),
TranslationBase.of(context).routine.toUpperCase(), TranslationBase.of(context).routine.toUpperCase(),
]; ];
return Center( return Container(
child: Container( height: MediaQuery.of(context).size.height * 0.065,
height: MediaQuery.of(context).size.height * 0.061999, width: SizeConfig.screenWidth * 0.9,
width: SizeConfig.screenWidth * 0.90, margin: EdgeInsets.only(top: 10),
margin: EdgeInsets.only(top: 10), decoration: BoxDecoration(
decoration: BoxDecoration( color: Color(0Xffffffff), borderRadius: BorderRadius.circular(20)),
color: Color(0Xffffffff), child: Row(
borderRadius: BorderRadius.circular(10), mainAxisAlignment: MainAxisAlignment.spaceEvenly,
border: Border.all(width: 0.3), mainAxisSize: MainAxisSize.max,
), crossAxisAlignment: CrossAxisAlignment.center,
child: Row( children: _priorities.map((item) {
mainAxisAlignment: MainAxisAlignment.spaceEvenly, bool _isActive = _priorities[_activePriority] == item ? true : false;
mainAxisSize: MainAxisSize.max, return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.center, InkWell(
children: _priorities.map((item) { child: Center(
bool _isActive = child: Container(
_priorities[_activePriority] == item ? true : false; height: 40,
return Column(mainAxisSize: MainAxisSize.min, children: <Widget>[ width: 90,
InkWell( decoration: BoxDecoration(
child: Center( borderRadius: BorderRadius.circular(50),
child: Container( color: _isActive ? HexColor("#B8382B") : Colors.white,
height: MediaQuery.of(context).size.height * 0.0559, ),
width: SizeConfig.screenWidth * 0.297, child: Center(
decoration: BoxDecoration( child: Text(
borderRadius: BorderRadius.only( item,
topLeft: Radius.circular(8.0), style: TextStyle(
bottomLeft: Radius.circular(8.0), fontSize: 12,
topRight: Radius.circular(10.0), color: _isActive
bottomRight: Radius.circular(10.0), ? Colors.white
), : Colors.black, //Colors.black,
color: _isActive ? Hexcolor("#B8382B") : Colors.white, // backgroundColor:_isActive
), // ? Hexcolor("#B8382B")
child: Center( // : Colors.white,//sideColor,
child: Text(
item,
style: TextStyle(
fontSize: 12,
color: _isActive
? Colors.white
: Colors.black, //Colors.black,
// backgroundColor:_isActive
// ? Hexcolor("#B8382B")
// : Colors.white,//sideColor,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
), ),
@ -509,25 +483,37 @@ class _ReferPatientState extends State<ReferPatientScreen> {
return time; return time;
} }
void referToDoctor(context) { referToDoctor(BuildContext context, PatientViewModel model) async {
if (!validation()) { if (!validation()) {
return; return;
} }
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute
.of(context)
.settings
.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
patientsProv.referToDoctor(context,
extension: _extController.value.text, try {
admissionNo: int.parse(patient.admissionNo), await model.referToDoctor(
referringDoctorRemarks: _remarksController.value.text, extension: _extController.value.text,
frequency: freqId, admissionNo: int.parse(patient.admissionNo),
patientID: patient.patientId, referringDoctorRemarks: _remarksController.value.text,
patientTypeID: patient.patientType, frequency: freqId,
priority: (_activePriority + 1).toString(), patientID: patient.patientId,
roomID: patient.roomId, patientTypeID: patient.patientType,
selectedClinicID: clinicId.toString(), priority: (_activePriority + 1).toString(),
selectedDoctorID: doctorId.toString(), roomID: patient.roomId,
projectID: patient.projectId); selectedClinicID: clinicId.toString(),
selectedDoctorID: doctorId.toString(),
projectID: patient.projectId);
// TODO: Add Translation
DrAppToastMsg.showSuccesToast(
'Reply Successfully');
Navigator.pop(context);
} catch (e) {
DrAppToastMsg.showErrorToast(e);
}
} }
bool validation() { bool validation() {

@ -1,20 +1,19 @@
import 'package:doctor_app_flutter/core/viewModel/patient_view_model.dart';
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart'; import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart';
import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart'; import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart'; import '../../../../config/size_config.dart';
import '../../../../lookups/patient_lookup.dart'; import '../../../../lookups/patient_lookup.dart';
import '../../../../models/patient/patiant_info_model.dart'; import '../../../../models/patient/patiant_info_model.dart';
import '../../../../models/patient/vital_sign/vital_sign_res_model.dart'; import '../../../../models/patient/vital_sign/vital_sign_res_model.dart';
import '../../../../providers/patients_provider.dart';
import '../../../../routes.dart'; import '../../../../routes.dart';
import '../../../../screens/patients/profile/vital_sign/vital_sign_item.dart'; import '../../../../screens/patients/profile/vital_sign/vital_sign_item.dart';
import '../../../../util/dr_app_shared_pref.dart'; import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
@ -28,8 +27,6 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
VitalSignResModel vitalSing; VitalSignResModel vitalSing;
String url = "assets/images/"; String url = "assets/images/";
PatientsProvider patientsProv;
var _isInit = true;
/* /*
*@author: Elham Rababah *@author: Elham Rababah
@ -38,7 +35,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
*@return: *@return:
*@desc: getVitalSignList Function *@desc: getVitalSignList Function
*/ */
getVitalSignList(context) async { getVitalSignList(BuildContext context, PatientViewModel model) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient']; PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
@ -57,18 +54,10 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
languageID: 2, languageID: 2,
transNo: transNo:
patient.admissionNo != null ? int.parse(patient.admissionNo) : 0); patient.admissionNo != null ? int.parse(patient.admissionNo) : 0);
patientsProv.getPatientVitalSign(vitalSignReqModel.toJson()); model.getPatientVitalSign(vitalSignReqModel.toJson());
} }
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getVitalSignList(context);
}
_isInit = false;
}
final double contWidth = SizeConfig.realScreenWidth * 0.70; final double contWidth = SizeConfig.realScreenWidth * 0.70;
@ -76,13 +65,12 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
Widget build(BuildContext context) { Widget build(BuildContext context) {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
vitalSing = routeArgs['vitalSing']; vitalSing = routeArgs['vitalSing'];
return AppScaffold( return BaseView<PatientViewModel>(
onModelReady: (model) => getVitalSignList(context, model),
builder: (_, model, w) => AppScaffold(
baseViewModel: model,
appBarTitle: TranslationBase.of(context).vitalSign, appBarTitle: TranslationBase.of(context).vitalSign,
body: patientsProv.isLoading body: model.patientVitalSignOrderdSubList.length == 0
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.patientVitalSignOrderdSubList.length == 0
? DrAppEmbeddedError( ? DrAppEmbeddedError(
error: 'You don\'t have any vital Sings') error: 'You don\'t have any vital Sings')
: Container( : Container(
@ -106,7 +94,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
des: TranslationBase.of(context) des: TranslationBase.of(context)
.bodyMeasurements, .bodyMeasurements,
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
lastVal: patientsProv lastVal: model
.patientVitalSignOrderdSubList[0] .patientVitalSignOrderdSubList[0]
.heightCm .heightCm
.toString(), .toString(),
@ -129,7 +117,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
des: TranslationBase.of(context) des: TranslationBase.of(context)
.temperature, .temperature,
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
lastVal: patientsProv lastVal: model
.patientVitalSignOrderdSubList[0] .patientVitalSignOrderdSubList[0]
.temperatureCelcius .temperatureCelcius
.toString(), .toString(),
@ -154,7 +142,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).pulse, des: TranslationBase.of(context).pulse,
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
lastVal: patientsProv lastVal: model
.patientVitalSignOrderdSubList[0] .patientVitalSignOrderdSubList[0]
.pulseBeatPerMinute .pulseBeatPerMinute
.toString(), .toString(),
@ -175,7 +163,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
des: des:
TranslationBase.of(context).respiration, TranslationBase.of(context).respiration,
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
lastVal: patientsProv lastVal: model
.patientVitalSignOrderdSubList[0] .patientVitalSignOrderdSubList[0]
.respirationBeatPerMinute .respirationBeatPerMinute
.toString(), .toString(),
@ -200,7 +188,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
des: TranslationBase.of(context) des: TranslationBase.of(context)
.bloodPressure, .bloodPressure,
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
lastVal: patientsProv lastVal: model
.patientVitalSignOrderdSubList[0] .patientVitalSignOrderdSubList[0]
.bloodPressure .bloodPressure
.toString(), .toString(),
@ -221,7 +209,7 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
des: des:
TranslationBase.of(context).oxygenation, TranslationBase.of(context).oxygenation,
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
lastVal: patientsProv lastVal: model
.patientVitalSignOrderdSubList[0].fIO2 .patientVitalSignOrderdSubList[0].fIO2
.toString(), .toString(),
unit: '', unit: '',
@ -243,14 +231,16 @@ class _VitalSignDetailsScreenState extends State<VitalSignDetailsScreen> {
}); });
}, },
child: VitalSignItem( child: VitalSignItem(
des: TranslationBase.of(context).painScale, des: TranslationBase
.of(context)
.painScale,
url: url + 'heartbeat.png', url: url + 'heartbeat.png',
), ),
), ),
], ],
), ),
], ],
), ),
)); ),),);
} }
} }

@ -48,7 +48,7 @@ class VitalSignItem extends StatelessWidget {
des, des,
style: TextStyle( style: TextStyle(
fontSize: 1.7 * SizeConfig.textMultiplier, fontSize: 1.7 * SizeConfig.textMultiplier,
color: Hexcolor('#B8382C'), color: HexColor('#B8382C'),
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
), ),
@ -71,7 +71,7 @@ class VitalSignItem extends StatelessWidget {
new TextSpan( new TextSpan(
text: ' ${unit}', text: ' ${unit}',
style: TextStyle( style: TextStyle(
color: Hexcolor('#B8382C'), color: HexColor('#B8382C'),
), ),
), ),
], ],

File diff suppressed because one or more lines are too long

@ -1,154 +0,0 @@
import 'package:doctor_app_flutter/models/patient/vital_sign/vital_sign_req_model.dart';
import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../../config/shared_pref_kay.dart';
import '../../../../config/size_config.dart';
import '../../../../models/patient/patiant_info_model.dart';
import '../../../../providers/patients_provider.dart';
import '../../../../util/dr_app_shared_pref.dart';
import '../../../../widgets/shared/app_scaffold_widget.dart';
import '../../../../widgets/shared/app_texts_widget.dart';
import '../../../../widgets/shared/card_with_bg_widget.dart';
import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart';
import '../../../../widgets/shared/profile_image_widget.dart';
DrAppSharedPreferances sharedPref = new DrAppSharedPreferances();
/*
*@author: Elham Rababah
*@Date:26/4/2020
*@param:
*@return:VitalSignScreen
*@desc: VitalSignScreen class
*/
class VitalSignScreen extends StatefulWidget {
@override
_VitalSignScreenState createState() => _VitalSignScreenState();
}
class _VitalSignScreenState extends State<VitalSignScreen> {
PatientsProvider patientsProv;
var _isInit = true;
/*
*@author: Elham Rababah
*@Date:28/4/2020
*@param: context
*@return:
*@desc: getVitalSignList Function
*/
getVitalSignList(context) async {
final routeArgs = ModalRoute.of(context).settings.arguments as Map;
PatiantInformtion patient = routeArgs['patient'];
String token = await sharedPref.getString(TOKEN);
String type = await sharedPref.getString(SLECTED_PATIENT_TYPE);
int inOutpatientType = 1;
if (type == '0') {
inOutpatientType = 2;
}
print(type);
VitalSignReqModel vitalSignReqModel = VitalSignReqModel(
patientID: patient.patientId,
projectID: patient.projectId,
tokenID: token,
patientTypeID: patient.patientType,
inOutpatientType: inOutpatientType,
languageID: 2,
transNo:
patient.admissionNo != null ? int.parse(patient.admissionNo) : 0);
patientsProv.getPatientVitalSign(vitalSignReqModel.toJson());
}
@override
void didChangeDependencies() {
super.didChangeDependencies();
if (_isInit) {
patientsProv = Provider.of<PatientsProvider>(context);
getVitalSignList(context);
}
_isInit = false;
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: "VITAL SIGN",
body: patientsProv.isLoading
? DrAppCircularProgressIndeicator()
: patientsProv.isError
? DrAppEmbeddedError(error: patientsProv.error)
: patientsProv.patientVitalSignList.length == 0
? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign')
: Container(
margin: EdgeInsets.fromLTRB(
SizeConfig.realScreenWidth * 0.05,
0,
SizeConfig.realScreenWidth * 0.05,
0),
child: ListView.builder(
itemCount: patientsProv.patientVitalSignList.length,
itemBuilder: (BuildContext ctxt, int index) {
return InkWell(
child: CardWithBgWidget(
widget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: <Widget>[
ProfileImageWidget(
url: patientsProv
.patientVitalSignList[index]
.doctorImageURL),
Expanded(
child: Padding(
padding: const EdgeInsets.fromLTRB(
8, 0, 0, 0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
AppText(
'${patientsProv.patientVitalSignList[index].doctorName}',
fontSize: 2.5 *
SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 8,
),
AppText(
' ${patientsProv.patientVitalSignList[index].clinicName}',
fontSize: 2 *
SizeConfig.textMultiplier,
color: Theme.of(context)
.primaryColor,
),
SizedBox(
height: 8,
),
],
),
),
)
],
),
],
),
),
onTap: () {
Navigator.of(context)
.pushNamed(VITAL_SIGN_DETAILS, arguments: {
'vitalSing':
patientsProv.patientVitalSignList[index]
});
},
);
}),
),
);
}
}

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/providers/hospital_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/hospital_view_model.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.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';
@ -34,7 +34,7 @@ class SettingsScreen extends StatelessWidget {
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 350), duration: Duration(milliseconds: 350),
decoration: BoxDecoration( decoration: BoxDecoration(
color: !projectsProvider.isArabic ? Hexcolor('#58434F') : Colors.transparent, color: !projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent,
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0)) border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
), ),
child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500])) child: Center(child: AppText(TranslationBase.of(context).lanEnglish, color: !projectsProvider.isArabic ? Colors.white : Colors.grey[500]))
@ -47,7 +47,7 @@ class SettingsScreen extends StatelessWidget {
child: AnimatedContainer( child: AnimatedContainer(
duration: Duration(milliseconds: 350), duration: Duration(milliseconds: 350),
decoration: BoxDecoration( decoration: BoxDecoration(
color: projectsProvider.isArabic ? Hexcolor('#58434F') : Colors.transparent, color: projectsProvider.isArabic ? HexColor('#58434F') : Colors.transparent,
border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0)) border: Border(right: BorderSide(color: Colors.grey[200], width: 2.0))
), ),
child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],)) child: Center(child: AppText(TranslationBase.of(context).lanArabic, color: projectsProvider.isArabic ? Colors.white : Colors.grey[500],))

@ -33,6 +33,8 @@ class TranslationBase {
String get mobileNo => localizedValues['mobileNo'][locale.languageCode]; String get mobileNo => localizedValues['mobileNo'][locale.languageCode];
String get replySuccessfully => localizedValues['replySuccessfully'][locale.languageCode];
String get messagesScreenToolbarTitle => String get messagesScreenToolbarTitle =>
localizedValues['messagesScreenToolbarTitle'][locale.languageCode]; localizedValues['messagesScreenToolbarTitle'][locale.languageCode];

@ -108,7 +108,7 @@ class AuthHeader extends StatelessWidget {
Text( Text(
text2, text2,
style: TextStyle( style: TextStyle(
color: Hexcolor('#B8382C'), color: HexColor('#B8382C'),
fontSize: textFontSize, fontSize: textFontSize,
fontWeight: FontWeight.w800), fontWeight: FontWeight.w800),
) )
@ -156,7 +156,7 @@ class AuthHeader extends StatelessWidget {
fontSize: fontSize:
SizeConfig.isMobile ? 26 : SizeConfig.realScreenWidth * 0.030, SizeConfig.isMobile ? 26 : SizeConfig.realScreenWidth * 0.030,
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
color: Hexcolor('#B8382C')), color: HexColor('#B8382C')),
), ),
); );
} }
@ -172,7 +172,7 @@ class AuthHeader extends StatelessWidget {
style: TextStyle( style: TextStyle(
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029, fontSize: SizeConfig.isMobile ? 24 : SizeConfig.realScreenWidth * 0.029,
color: Hexcolor('#B8382C'), color: HexColor('#B8382C'),
), ),
); );
} }

@ -30,7 +30,7 @@ class ChangePassword extends StatelessWidget {
TextStyle(fontSize: 2 * SizeConfig.textMultiplier), TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)), borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')), borderSide: BorderSide(color: HexColor('#CCCCCC')),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -69,7 +69,7 @@ class ChangePassword extends StatelessWidget {
TextStyle(fontSize: 2 * SizeConfig.textMultiplier), TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)), borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')), borderSide: BorderSide(color: HexColor('#CCCCCC')),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -98,7 +98,7 @@ class ChangePassword extends StatelessWidget {
TextStyle(fontSize: 2 * SizeConfig.textMultiplier), TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)), borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')), borderSide: BorderSide(color: HexColor('#CCCCCC')),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -137,7 +137,7 @@ class ChangePassword extends StatelessWidget {
), ),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))), side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
), ),
SizedBox( SizedBox(
height: 10, height: 10,

@ -8,7 +8,7 @@ import 'package:provider/provider.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../providers/auth_provider.dart'; import '../../core/viewModel/auth_view_model.dart';
import '../../routes.dart'; import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_shared_pref.dart';
import '../../util/dr_app_toast_msg.dart'; import '../../util/dr_app_toast_msg.dart';
@ -69,7 +69,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthProvider authProv = Provider.of<AuthProvider>(context); AuthViewModel authProv = Provider.of<AuthViewModel>(context);
var imeiModel = {'IMEI': _platformImei}; var imeiModel = {'IMEI': _platformImei};
_loginTypeFuture = authProv.selectDeviceImei(imeiModel); _loginTypeFuture = authProv.selectDeviceImei(imeiModel);
return FutureBuilder( return FutureBuilder(
@ -97,7 +97,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
Container( Container(
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Hexcolor('#CCCCCC'), color: HexColor('#CCCCCC'),
), ),
borderRadius: BorderRadius.circular(50)), borderRadius: BorderRadius.circular(50)),
margin: const EdgeInsets.fromLTRB(0, 20.0, 30, 0), margin: const EdgeInsets.fromLTRB(0, 20.0, 30, 0),
@ -111,7 +111,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
// color: Colors.green, // border color // color: Colors.green, // border color
shape: BoxShape.circle, shape: BoxShape.circle,
border: border:
Border.all(color: Hexcolor('#CCCCCC'))), Border.all(color: HexColor('#CCCCCC'))),
child: CircleAvatar( child: CircleAvatar(
child: Image.asset( child: Image.asset(
'assets/images/dr_avatar.png', 'assets/images/dr_avatar.png',
@ -129,7 +129,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
_loggedUser['List_MemberInformation'][0] _loggedUser['List_MemberInformation'][0]
['MemberName'], ['MemberName'],
style: TextStyle( style: TextStyle(
color: Hexcolor('515A5D'), color: HexColor('515A5D'),
fontSize: fontSize:
2.5 * SizeConfig.textMultiplier, 2.5 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w800), fontWeight: FontWeight.w800),
@ -137,7 +137,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
Text( Text(
'ENT Spec', 'ENT Spec',
style: TextStyle( style: TextStyle(
color: Hexcolor('515A5D'), color: HexColor('515A5D'),
fontSize: fontSize:
1.5 * SizeConfig.textMultiplier), 1.5 * SizeConfig.textMultiplier),
) )
@ -203,7 +203,7 @@ class _KnownUserLoginState extends State<KnownUserLogin> {
), ),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))), side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
), ),
SizedBox( SizedBox(
height: 10, height: 10,

@ -10,8 +10,8 @@ import 'package:provider/provider.dart';
import '../../config/shared_pref_kay.dart'; import '../../config/shared_pref_kay.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../models/doctor/user_model.dart'; import '../../models/doctor/user_model.dart';
import '../../providers/auth_provider.dart'; import '../../core/viewModel/auth_view_model.dart';
import '../../providers/hospital_provider.dart'; import '../../core/viewModel/hospital_view_model.dart';
import '../../routes.dart'; import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_shared_pref.dart';
import '../../util/dr_app_toast_msg.dart'; import '../../util/dr_app_toast_msg.dart';
@ -51,7 +51,7 @@ class _LoginFormState extends State<LoginForm> {
channel: 9, channel: 9,
sessionID: "i1UJwCTSqt"); sessionID: "i1UJwCTSqt");
AuthProvider authProv; AuthViewModel authProv;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -61,7 +61,7 @@ class _LoginFormState extends State<LoginForm> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
authProv = Provider.of<AuthProvider>(context); authProv = Provider.of<AuthViewModel>(context);
if (_isInit) { if (_isInit) {
if (projectsList.length == 0) { if (projectsList.length == 0) {
@ -159,7 +159,7 @@ class _LoginFormState extends State<LoginForm> {
padding: const EdgeInsets.all(0.0), padding: const EdgeInsets.all(0.0),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: BorderSide(width: 0.5, color: Hexcolor('#CCCCCC'))), side: BorderSide(width: 0.5, color: HexColor('#CCCCCC'))),
child: Container( child: Container(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
height: 50, height: 50,
@ -199,7 +199,7 @@ class _LoginFormState extends State<LoginForm> {
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(20)), borderRadius: BorderRadius.all(Radius.circular(20)),
borderSide: BorderSide(color: Hexcolor('#CCCCCC')), borderSide: BorderSide(color: HexColor('#CCCCCC')),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -222,7 +222,7 @@ class _LoginFormState extends State<LoginForm> {
); );
} }
login(context, AuthProvider authProv, Function changeLoadingStata) { login(context, AuthViewModel authProv, Function changeLoadingStata) {
FocusScopeNode currentFocus = FocusScope.of(context); FocusScopeNode currentFocus = FocusScope.of(context);
// if (!currentFocus.hasPrimaryFocus) { // if (!currentFocus.hasPrimaryFocus) {
@ -258,7 +258,7 @@ class _LoginFormState extends State<LoginForm> {
} }
} }
insertDeviceImei(preRes, AuthProvider authProv) { insertDeviceImei(preRes, AuthViewModel authProv) {
if (_platformImei != 'Unknown') { if (_platformImei != 'Unknown') {
var imeiInfo = { var imeiInfo = {
"IMEI": _platformImei, "IMEI": _platformImei,
@ -323,7 +323,7 @@ class _LoginFormState extends State<LoginForm> {
} }
getProjectsList() { getProjectsList() {
HospitalProvider projectsProv = Provider.of<HospitalProvider>(context); HospitalViewModel projectsProv = Provider.of<HospitalViewModel>(context);
projectsProv.getProjectsList().then((res) { projectsProv.getProjectsList().then((res) {
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
setState(() { setState(() {

@ -2,12 +2,13 @@ import 'dart:async';
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/providers/auth_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
Helpers helpers = Helpers();
class ShowTimerText extends StatefulWidget { class ShowTimerText extends StatefulWidget {
ShowTimerText({Key key, this.model}); ShowTimerText({Key key, this.model});
@ -23,7 +24,7 @@ class _ShowTimerTextState extends State<ShowTimerText> {
int sec = 59; int sec = 59;
Timer _timer; Timer _timer;
AuthProvider authProv; AuthViewModel authProv;
resendCode() { resendCode() {
min = TIMER_MIN - 1; min = TIMER_MIN - 1;
@ -63,7 +64,7 @@ class _ShowTimerTextState extends State<ShowTimerText> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProv = Provider.of<AuthProvider>(context); authProv = Provider.of<AuthViewModel>(context);
return Center( return Center(
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -78,7 +79,7 @@ class _ShowTimerTextState extends State<ShowTimerText> {
timerText, timerText,
style: TextStyle( style: TextStyle(
fontSize: 3.0 * SizeConfig.textMultiplier, fontSize: 3.0 * SizeConfig.textMultiplier,
color: Hexcolor('#B8382C'), color: HexColor('#B8382C'),
fontWeight: FontWeight.bold), fontWeight: FontWeight.bold),
), ),
), ),

@ -10,7 +10,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../providers/auth_provider.dart'; import '../../core/viewModel/auth_view_model.dart';
import '../../routes.dart'; import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_shared_pref.dart';
import '../../util/dr_app_toast_msg.dart'; import '../../util/dr_app_toast_msg.dart';
@ -40,7 +40,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
}; };
Future _loggedUserFuture; Future _loggedUserFuture;
var _loggedUser; var _loggedUser;
AuthProvider authProv; AuthViewModel authProv;
bool _isInit = true; bool _isInit = true;
var model; var model;
TextEditingController digit1 = TextEditingController(text: ""); TextEditingController digit1 = TextEditingController(text: "");
@ -64,7 +64,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
void didChangeDependencies() { void didChangeDependencies() {
super.didChangeDependencies(); super.didChangeDependencies();
if (_isInit) { if (_isInit) {
authProv = Provider.of<AuthProvider>(context); authProv = Provider.of<AuthViewModel>(context);
final routeArgs = ModalRoute.of(context).settings.arguments as Map; final routeArgs = ModalRoute.of(context).settings.arguments as Map;
model = routeArgs['model']; model = routeArgs['model'];
} }
@ -73,7 +73,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
authProv = Provider.of<AuthProvider>(context); authProv = Provider.of<AuthViewModel>(context);
final focusD1 = FocusNode(); final focusD1 = FocusNode();
final focusD2 = FocusNode(); final focusD2 = FocusNode();
final focusD3 = FocusNode(); final focusD3 = FocusNode();
@ -227,7 +227,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10),
side: BorderSide( side: BorderSide(
width: 0.5, width: 0.5,
color: Hexcolor('#CCCCCC'))), color: HexColor('#CCCCCC'))),
), ),
buildSizedBox(20), buildSizedBox(20),
ShowTimerText(model: model), ShowTimerText(model: model),
@ -335,7 +335,7 @@ class _VerifyAccountState extends State<VerifyAccount> {
*@return: *@return:
*@desc: verify Account func call sendActivationCodeByOtpNotificationType service *@desc: verify Account func call sendActivationCodeByOtpNotificationType service
*/ */
verifyAccount(AuthProvider authProv, Function changeLoadingStata) async { verifyAccount(AuthViewModel authProv, Function changeLoadingStata) async {
if (verifyAccountForm.currentState.validate()) { if (verifyAccountForm.currentState.validate()) {
changeLoadingStata(true); changeLoadingStata(true);

@ -6,7 +6,7 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../../config/size_config.dart'; import '../../config/size_config.dart';
import '../../providers/auth_provider.dart'; import '../../core/viewModel/auth_view_model.dart';
import '../../routes.dart'; import '../../routes.dart';
import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_shared_pref.dart';
import '../../util/helpers.dart'; import '../../util/helpers.dart';
@ -57,7 +57,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthProvider authProv = Provider.of<AuthProvider>(context); AuthViewModel authProv = Provider.of<AuthViewModel>(context);
return FutureBuilder( return FutureBuilder(
future: Future.wait([_loggedUserFuture]), future: Future.wait([_loggedUserFuture]),
builder: (BuildContext context, AsyncSnapshot snapshot) { builder: (BuildContext context, AsyncSnapshot snapshot) {
@ -145,7 +145,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: Center widget *@return: Center widget
*@desc: buildSMSMethod Methods widget *@desc: buildSMSMethod Methods widget
*/ */
Center buildSMSMethod(BuildContext context, AuthProvider authProv) { Center buildSMSMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod( return buildVerificationMethod(
context, context,
'assets/images/verification_sms_icon.png', 'assets/images/verification_sms_icon.png',
@ -161,7 +161,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: Center widget *@return: Center widget
*@desc: build WhatsApp Methods widget *@desc: build WhatsApp Methods widget
*/ */
Center buildWhatsAppMethod(BuildContext context, AuthProvider authProv) { Center buildWhatsAppMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod( return buildVerificationMethod(
context, context,
'assets/images/verification_whatsapp_icon.png', 'assets/images/verification_whatsapp_icon.png',
@ -177,7 +177,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: Center widget *@return: Center widget
*@desc: build FaceID Methods widget *@desc: build FaceID Methods widget
*/ */
Center buildFaceIDMethod(BuildContext context, AuthProvider authProv) { Center buildFaceIDMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod( return buildVerificationMethod(
context, context,
'assets/images/verification_faceid_icon.png', 'assets/images/verification_faceid_icon.png',
@ -193,7 +193,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: Center widget *@return: Center widget
*@desc: build Fingerprint Methods widget *@desc: build Fingerprint Methods widget
*/ */
Center buildFingerprintMethod(BuildContext context, AuthProvider authProv) { Center buildFingerprintMethod(BuildContext context, AuthViewModel authProv) {
return buildVerificationMethod( return buildVerificationMethod(
context, context,
'assets/images/verification_fingerprint_icon.png', 'assets/images/verification_fingerprint_icon.png',
@ -222,7 +222,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 1, width: 1,
color: Hexcolor( color: HexColor(
'#CCCCCC') // <--- border width here '#CCCCCC') // <--- border width here
), ),
borderRadius: BorderRadius.all(Radius.circular(10))), borderRadius: BorderRadius.all(Radius.circular(10))),
@ -262,7 +262,7 @@ class _VerificationMethodsState extends State<VerificationMethods> {
*@return: *@return:
*@desc: send Activation Code By Otp Notification Type *@desc: send Activation Code By Otp Notification Type
*/ */
sendActivationCodeByOtpNotificationType(oTPSendType, AuthProvider authProv) { sendActivationCodeByOtpNotificationType(oTPSendType, AuthViewModel authProv) {
// TODO : build enum for verfication method // TODO : build enum for verfication method
if (oTPSendType == 1 || oTPSendType == 2) { if (oTPSendType == 1 || oTPSendType == 2) {
widget.changeLoadingStata(true); widget.changeLoadingStata(true);

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import '../shared/rounded_container_widget.dart'; import '../shared/rounded_container_widget.dart';

@ -28,7 +28,7 @@ class _DoctorReplyWidgetState extends State<DoctorReplyWidget> {
margin: EdgeInsets.symmetric(vertical: 10.0), margin: EdgeInsets.symmetric(vertical: 10.0),
width: double.infinity, width: double.infinity,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#FFFFFF'), color: HexColor('#FFFFFF'),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(20.0), Radius.circular(20.0),
), ),

@ -81,7 +81,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
Expanded( Expanded(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#515B5D'), color: HexColor('#515B5D'),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0), topLeft: Radius.circular(10.0),
), ),
@ -98,7 +98,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
), ),
Expanded( Expanded(
child: Container( child: Container(
color: Hexcolor('#515B5D'), color: HexColor('#515B5D'),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context).value, TranslationBase.of(context).value,
@ -109,7 +109,7 @@ class _LabResultWidgetState extends State<LabResultWidget> {
Expanded( Expanded(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#515B5D'), color: HexColor('#515B5D'),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0), topRight: Radius.circular(10.0),
), ),

@ -10,13 +10,18 @@ import 'package:doctor_app_flutter/widgets/shared/TextFields.dart';
import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_button.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
class MyReferralPatientWidget extends StatefulWidget { class MyReferralPatientWidget extends StatefulWidget {
final MyReferralPatientModel myReferralPatientModel; final MyReferralPatientModel myReferralPatientModel;
final ReferralPatientViewModel model; final ReferralPatientViewModel model;
MyReferralPatientWidget({Key key, this.myReferralPatientModel, this.model}); final bool isExpand;
final Function expandClick;
MyReferralPatientWidget({Key key, this.myReferralPatientModel, this.model, this.isExpand, this.expandClick});
@override @override
_MyReferralPatientWidgetState createState() => _MyReferralPatientWidgetState createState() =>
@ -24,7 +29,6 @@ class MyReferralPatientWidget extends StatefulWidget {
} }
class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> { class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
bool _showDetails = false;
bool _isLoading = false; bool _isLoading = false;
final _formKey = GlobalKey<FormState>(); final _formKey = GlobalKey<FormState>();
String error; String error;
@ -39,299 +43,416 @@ class _MyReferralPatientWidgetState extends State<MyReferralPatientWidget> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return CardWithBgWidgetNew( return Container(
widget: Container( width: double.infinity,
child: Column( margin: EdgeInsets.symmetric(horizontal: 8),
crossAxisAlignment: CrossAxisAlignment.start, padding: EdgeInsets.only(left: 0, top: 8, right: 0, bottom: 0),
children: <Widget>[ decoration: BoxDecoration(
InkWell( shape: BoxShape.rectangle,
onTap: () { borderRadius: BorderRadius.circular(8),
setState(() { border: Border.fromBorderSide(BorderSide(
_showDetails = !_showDetails; color: Color(0xffCCCCCC),
}); width: 2,
}, )),
child: Row( color: Color(0xffffffff),
mainAxisAlignment: MainAxisAlignment.spaceBetween, ),
children: <Widget>[ child: Column(
AppText( crossAxisAlignment: CrossAxisAlignment.start,
'${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.lastName}', children: <Widget>[
fontSize: 2.5 * SizeConfig.textMultiplier, HeaderBodyExpandableNotifier(
fontWeight: FontWeight.bold, headerWidget: Column(
), children: [
Icon(_showDetails Container(
? Icons.keyboard_arrow_up padding:
: Icons.keyboard_arrow_down), EdgeInsets.only(left: 16, top: 8, right: 8, bottom: 0),
], child: Row(
), crossAxisAlignment: CrossAxisAlignment.start,
), children: [
!_showDetails Expanded(
? Container() child: Column(
: AnimatedContainer( crossAxisAlignment: CrossAxisAlignment.start,
duration: Duration(milliseconds: 200), children: [
child: Column( Container(
crossAxisAlignment: CrossAxisAlignment.start, color: Color(0xFFB8382C),
children: <Widget>[ padding: EdgeInsets.symmetric(
SizedBox( vertical: 4, horizontal: 4),
height: 5, child: AppText(
), '${widget.myReferralPatientModel.priorityDescription}',
Divider( fontSize: 1.7 * SizeConfig.textMultiplier,
color: Color(0xFF000000), fontWeight: FontWeight.bold,
height: 0.5, textAlign: TextAlign.start,
color: Colors.white,
),
),
SizedBox(
height: 10,
),
AppText(
'${widget.myReferralPatientModel.firstName} ${widget.myReferralPatientModel.middleName} ${widget.myReferralPatientModel.lastName}',
fontSize: 2 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
SizedBox(
height: 10,
),
Row(
children: [
AppText(
TranslationBase.of(context).fileNo,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
SizedBox(
width: 20,
),
AppText(
'${widget.myReferralPatientModel.referralDoctor}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
),
],
),
],
), ),
Table( ),
border: TableBorder.symmetric( Container(
inside: BorderSide(width: 0.5), margin:
EdgeInsets.symmetric(horizontal: 8, vertical: 8),
child: InkWell(
onTap: widget.expandClick,
child: Image.asset(
"assets/images/ic_circle_arrow.png",
width: 25,
height: 25,
color: Colors.black,
), ),
children: [ ),
TableRow(children: [ )
Container( ],
margin: EdgeInsets.all(2.5), ),
padding: EdgeInsets.all(5), ),
child: Column( SizedBox(
crossAxisAlignment: CrossAxisAlignment.start, height: 10,
children: <Widget>[ ),
AppText( ],
TranslationBase.of(context).fileNo, ),
fontSize: 1.7 * SizeConfig.textMultiplier, bodyWidget: Container(
fontWeight: FontWeight.bold, child: Column(
), children: [
SizedBox( const Divider(
height: 5, color: Color(0xffCCCCCC),
), height: 1,
AppText( thickness: 2,
'${widget.myReferralPatientModel.referringDoctor}', indent: 0,
fontSize: 1.7 * SizeConfig.textMultiplier, endIndent: 0,
fontWeight: FontWeight.w300, ),
) Container(
], height: 1.8 * SizeConfig.textMultiplier * 6,
padding:
EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0),
child: Expanded(
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
), ),
), SizedBox(
Container( child: AppText(
margin: EdgeInsets.only( TranslationBase.of(context).referralDoctor,
left: 4, top: 2.5, right: 2.5, bottom: 2.5), fontSize: 1.9 * SizeConfig.textMultiplier,
padding: EdgeInsets.all(5), fontWeight: FontWeight.bold,
child: Column( textAlign: TextAlign.start,
crossAxisAlignment: CrossAxisAlignment.start, color: Colors.black,
children: <Widget>[ ),
AppText(
TranslationBase.of(context)
.referralDoctor,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
widget.myReferralPatientModel
.referringClinicDescription,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
), SizedBox(
]), height: 4,
TableRow(children: [ ),
Container( SizedBox(
margin: EdgeInsets.all(2.5), child: AppText(
padding: EdgeInsets.all(5), '${widget.myReferralPatientModel.referringDoctorName}',
child: Column( fontSize: 1.7 * SizeConfig.textMultiplier,
crossAxisAlignment: CrossAxisAlignment.start, fontWeight: FontWeight.normal,
children: <Widget>[ textAlign: TextAlign.start,
AppText( color: Colors.black,
TranslationBase.of(context) ),
.referringClinic,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
'${widget.myReferralPatientModel.referringClinicDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
SizedBox(
height: 8,
),
],
),
),
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: SizedBox(
child: Container(
color: Color(0xffCCCCCC),
), ),
Container( width: 1,
margin: EdgeInsets.only( ),
left: 4, top: 2.5, right: 2.5, bottom: 2.5), ),
padding: EdgeInsets.all(5), Expanded(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: [
AppText( SizedBox(
TranslationBase.of(context).frequency, height: 8,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
widget.myReferralPatientModel
.frequencyDescription,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
) SizedBox(
]), child: AppText(
TableRow( TranslationBase.of(context).referringClinic,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 4,
),
SizedBox(
child: AppText(
'${widget.myReferralPatientModel.referringClinicDescription}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 8,
),
],
),
),
],
),
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
),
Container(
height: 1.8 * SizeConfig.textMultiplier * 6,
padding:
EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0),
child: Expanded(
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( SizedBox(
margin: EdgeInsets.all(2.5), height: 8,
padding: EdgeInsets.all(5), ),
child: Column( SizedBox(
crossAxisAlignment: child: AppText(
CrossAxisAlignment.start, TranslationBase.of(context).frequency,
children: <Widget>[ fontSize: 1.9 * SizeConfig.textMultiplier,
AppText( fontWeight: FontWeight.bold,
TranslationBase.of(context).priority, textAlign: TextAlign.start,
fontSize: color: Colors.black,
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
'${widget.myReferralPatientModel.priorityDescription}',
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
), ),
Container( SizedBox(
margin: EdgeInsets.only( height: 4,
left: 4, ),
top: 2.5, SizedBox(
right: 2.5, child: AppText(
bottom: 2.5), '${widget.myReferralPatientModel.frequencyDescription}',
padding: EdgeInsets.all(5), fontSize: 1.7 * SizeConfig.textMultiplier,
child: Column( fontWeight: FontWeight.normal,
crossAxisAlignment: textAlign: TextAlign.start,
CrossAxisAlignment.start, color: Colors.black,
children: <Widget>[
AppText(
TranslationBase.of(context)
.maxResponseTime,
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
),
SizedBox(
height: 5,
),
AppText(
Helpers.getDateFormatted(widget
.myReferralPatientModel
.mAXResponseTime),
fontSize:
1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.w300,
)
],
), ),
) ),
SizedBox(
height: 8,
),
], ],
), ),
], ),
), Padding(
Divider( padding: const EdgeInsets.symmetric(horizontal: 8),
color: Color(0xFF000000), child: SizedBox(
height: 0.5, child: Container(
), color: Color(0xffCCCCCC),
SizedBox( ),
height: 5, width: 1,
),
Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
AppText(
TranslationBase.of(context)
.clinicDetailsandRemarks,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
), ),
Texts(
'${widget.myReferralPatientModel.referringDoctorRemarks}',
style: "bodyText1",
readMore: true,
textAlign: TextAlign.start,
maxLength: 100)
],
),
SizedBox(
height: 5,
),
AppText(
TranslationBase.of(context).answerSuggestions,
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
),
SizedBox(
height: 5,
),
Form(
key: _formKey,
child: TextFields(
controller:answerController,
maxLines: 2,
minLines: 2,
hintText:
TranslationBase.of(context).answerThePatient,
fontWeight: FontWeight.normal,
readOnly: _isLoading,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.pleaseEnterAnswer;
else
return null;
},
), ),
), Expanded(
SizedBox(height: 10.0), child: Column(
SizedBox(height: 10.0), crossAxisAlignment: CrossAxisAlignment.start,
Container( children: [
width: double.infinity, SizedBox(
margin: EdgeInsets.only(left: 10, right: 10), height: 8,
child: Button( ),
onTap: () async { SizedBox(
final form = _formKey.currentState; child: AppText(
if (form.validate()) { TranslationBase.of(context).maxResponseTime,
fontSize: 1.9 * SizeConfig.textMultiplier,
try { fontWeight: FontWeight.bold,
await widget.model textAlign: TextAlign.start,
.replay(answerController.text.toString(), color: Colors.black,
widget.myReferralPatientModel); ),
// TODO: Add Translation ),
DrAppToastMsg.showSuccesToast( SizedBox(
'Reply Successfully'); height: 4,
} catch (e) { ),
DrAppToastMsg.showErrorToast(e); SizedBox(
} child: AppText(
} '${DateFormat('dd/MM/yyyy').format(widget.myReferralPatientModel.mAXResponseTime)}',
}, fontSize: 1.7 * SizeConfig.textMultiplier,
title: TranslationBase.of(context).replay, fontWeight: FontWeight.normal,
loading: widget.model.state == ViewState.BusyLocal, textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 8,
),
],
),
),
],
),
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
),
Container(
padding:
EdgeInsets.only(left: 16, top: 0, right: 8, bottom: 0),
child: Expanded(
child: Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 8,
),
SizedBox(
child: AppText(
TranslationBase.of(context)
.clinicDetailsandRemarks,
fontSize: 1.9 * SizeConfig.textMultiplier,
fontWeight: FontWeight.bold,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 4,
),
SizedBox(
child: AppText(
'${widget.myReferralPatientModel.referringDoctorRemarks}',
fontSize: 1.7 * SizeConfig.textMultiplier,
fontWeight: FontWeight.normal,
textAlign: TextAlign.start,
color: Colors.black,
),
),
SizedBox(
height: 8,
),
],
),
), ),
) ],
], ),
),
),
const Divider(
color: Color(0xffCCCCCC),
height: 1,
thickness: 2,
indent: 0,
endIndent: 0,
),
SizedBox(
height: 10,
),
Container(
color: Colors.white,
padding: EdgeInsets.all(8),
child: Form(
key: _formKey,
child: TextFields(
controller: answerController,
maxLines: 3,
minLines: 2,
hintText: TranslationBase.of(context).answerThePatient,
fontWeight: FontWeight.normal,
readOnly: _isLoading,
validator: (value) {
if (value.isEmpty)
return TranslationBase.of(context)
.pleaseEnterAnswer;
else
return null;
},
),
),
),
Container(
width: double.infinity,
margin: EdgeInsets.only(left: 10, right: 10),
child: Button(
onTap: () async {
final form = _formKey.currentState;
if (form.validate()) {
try {
await widget.model.replay(
answerController.text.toString(),
widget.myReferralPatientModel);
DrAppToastMsg.showSuccesToast(
TranslationBase.of(context).replySuccessfully);
} catch (e) {
DrAppToastMsg.showErrorToast(e);
}
}
},
title: TranslationBase.of(context).replay,
loading: widget.model.state == ViewState.BusyLocal,
), ),
) )
], ],
), ),
),
isExpand: widget.isExpand,
),
],
), ),
); );
} }

@ -1,8 +1,5 @@
import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart';
import 'package:doctor_app_flutter/providers/patients_provider.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import './profile_general_info_content_widget.dart'; import './profile_general_info_content_widget.dart';
import '../../../config/size_config.dart'; import '../../../config/size_config.dart';

@ -30,11 +30,11 @@ class ProfileGeneralInfoContentWidget extends StatelessWidget {
title, title,
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Hexcolor('#58434F'), color: HexColor('#58434F'),
), ),
AppText( AppText(
info, info,
color: Hexcolor('#707070'), color: HexColor('#707070'),
fontSize: SizeConfig.textMultiplier * 2, fontSize: SizeConfig.textMultiplier * 2,
) )
], ],

@ -33,7 +33,7 @@ class ProfileHeaderWidget extends StatelessWidget {
des: patient.patientId.toString(), des: patient.patientId.toString(),
height: SizeConfig.heightMultiplier * 17, height: SizeConfig.heightMultiplier * 17,
width: SizeConfig.heightMultiplier * 17, width: SizeConfig.heightMultiplier * 17,
color: Hexcolor('#58434F')), color: HexColor('#58434F')),
); );
} }
} }

@ -114,7 +114,7 @@ class CircleAvatarWidget extends StatelessWidget {
decoration: new BoxDecoration( decoration: new BoxDecoration(
// color: Colors.green, // border color // color: Colors.green, // border color
shape: BoxShape.circle, shape: BoxShape.circle,
border: Border.all(color: Hexcolor('#B7831A'), width: 1.5)), border: Border.all(color: HexColor('#B7831A'), width: 1.5)),
child: CircleAvatar( child: CircleAvatar(
radius: SizeConfig.imageSizeMultiplier * 12, radius: SizeConfig.imageSizeMultiplier * 12,
child: Image.asset(url), child: Image.asset(url),

@ -32,11 +32,11 @@ class ProfileStatusInfoWidget extends StatelessWidget {
'Insurance approval', 'Insurance approval',
fontSize: SizeConfig.textMultiplier * 3, fontSize: SizeConfig.textMultiplier * 3,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
color: Hexcolor('#58434F'), color: HexColor('#58434F'),
), ),
AppText( AppText(
'Approved', 'Approved',
color: Hexcolor('#707070'), color: HexColor('#707070'),
fontSize: SizeConfig.textMultiplier * 2.5, fontSize: SizeConfig.textMultiplier * 2.5,
) )
], ],

@ -54,7 +54,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#515B5D'), color: HexColor('#515B5D'),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0), topLeft: Radius.circular(10.0),
), ),
@ -71,7 +71,7 @@ class _VitalSignDetailsWidgetState extends State<VitalSignDetailsWidget> {
Container( Container(
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#515B5D'), color: HexColor('#515B5D'),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topRight: Radius.circular(10.0), topRight: Radius.circular(10.0),
), ),

@ -226,7 +226,7 @@ class _TextsState extends State<Texts> {
}, },
child: Text(hidden ? "Read More" : "Read less", child: Text(hidden ? "Read More" : "Read less",
style: _getFontStyle().copyWith( style: _getFontStyle().copyWith(
color: Hexcolor('#FF0000'), color: HexColor('#FF0000'),
fontWeight: FontWeight.w800, fontWeight: FontWeight.w800,
fontFamily: "WorkSans" fontFamily: "WorkSans"
) )

@ -95,7 +95,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
? 22.0 ? 22.0
: 19), : 19),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Hexcolor('#515b5d'), color: HexColor('#515b5d'),
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
boxShadow: [ boxShadow: [
BoxShadow( BoxShadow(
@ -121,7 +121,7 @@ class _ButtonState extends State<Button> with TickerProviderStateMixin {
child: CircularProgressIndicator( child: CircularProgressIndicator(
backgroundColor: Colors.white, backgroundColor: Colors.white,
valueColor: AlwaysStoppedAnimation<Color>( valueColor: AlwaysStoppedAnimation<Color>(
Hexcolor('#FFDDD9'), HexColor('#FFDDD9'),
), ),
), ),
), ),

@ -26,7 +26,7 @@ class AppButton extends StatefulWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
return return
RawMaterialButton( RawMaterialButton(
fillColor: widget.color != null ? widget.color : Hexcolor("#B8382C"), fillColor: widget.color != null ? widget.color : HexColor("#B8382C"),
splashColor: widget.color, splashColor: widget.color,
child: Padding( child: Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(

@ -1,5 +1,5 @@
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/providers/auth_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/auth_view_model.dart';
import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/helpers.dart';
import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -40,7 +40,7 @@ class _AppDrawerState extends State<AppDrawer> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
AuthProvider authProvider = Provider.of(context); AuthViewModel authProvider = Provider.of(context);
return RoundedContainer( return RoundedContainer(
child: Container( child: Container(
color: Colors.white, color: Colors.white,

@ -1,6 +1,6 @@
import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/base_view_model.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/routes.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -33,7 +33,7 @@ class AppScaffold extends StatelessWidget {
appBar: isShowAppBar appBar: isShowAppBar
? AppBar( ? AppBar(
elevation: 0, elevation: 0,
backgroundColor: Hexcolor('#515B5D'), backgroundColor: HexColor('#515B5D'),
textTheme: TextTheme(headline6: TextStyle(color: Colors.white)), textTheme: TextTheme(headline6: TextStyle(color: Colors.white)),
title: Text(appBarTitle.toUpperCase()), title: Text(appBarTitle.toUpperCase()),
leading: Builder(builder: (BuildContext context) { leading: Builder(builder: (BuildContext context) {

@ -55,12 +55,12 @@ class AppTextFormField extends FormField<String> {
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
borderRadius: BorderRadius.all(Radius.circular(6)), borderRadius: BorderRadius.all(Radius.circular(6)),
borderSide: BorderSide( borderSide: BorderSide(
color: borderColor != null ? borderColor : Hexcolor( color: borderColor != null ? borderColor : HexColor(
"#CCCCCC")), "#CCCCCC")),
), ),
focusedBorder: OutlineInputBorder( focusedBorder: OutlineInputBorder(
borderSide: BorderSide( borderSide: BorderSide(
color: borderColor != null ? borderColor : Hexcolor( color: borderColor != null ? borderColor : HexColor(
"#CCCCCC")), "#CCCCCC")),
borderRadius: BorderRadius.all(Radius.circular(6)), borderRadius: BorderRadius.all(Radius.circular(6)),
) )

@ -1,5 +1,5 @@
import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/config/size_config.dart';
import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
@ -31,7 +31,7 @@ class CardWithBgWidgetNew extends StatelessWidget {
), ),
child: Material( child: Material(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
color: Hexcolor('#FFFFFF'), color: HexColor('#FFFFFF'),
child: Stack( child: Stack(
children: [ children: [
Center( Center(

@ -1,4 +1,4 @@
import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart'; import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -26,7 +26,7 @@ class CardWithBgWidget extends StatelessWidget {
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(10.0), Radius.circular(10.0),
), ),
border: Border.all(color: Hexcolor('#707070'), width: 2.0), border: Border.all(color: HexColor('#707070'), width: 2.0),
), ),
child: Material( child: Material(
borderRadius: BorderRadius.all(Radius.circular(10.0)), borderRadius: BorderRadius.all(Radius.circular(10.0)),
@ -36,7 +36,7 @@ class CardWithBgWidget extends StatelessWidget {
Positioned( Positioned(
child: Container( child: Container(
width: 10, width: 10,
color: Hexcolor('#58434F'), color: HexColor('#58434F'),
), ),
bottom: 0, bottom: 0,
top: 0, top: 0,
@ -46,7 +46,7 @@ class CardWithBgWidget extends StatelessWidget {
Positioned( Positioned(
child: Container( child: Container(
width: 10, width: 10,
color: Hexcolor('#58434F'), color: HexColor('#58434F'),
), ),
bottom: 0, bottom: 0,
top: 0, top: 0,

@ -0,0 +1,67 @@
import 'package:expandable/expandable.dart';
import 'package:flutter/material.dart';
class HeaderBodyExpandableNotifier extends StatefulWidget {
final Widget headerWidget;
final Widget bodyWidget;
final Widget collapsed;
final bool isExpand;
bool expandFlag = false;
var controller = new ExpandableController();
HeaderBodyExpandableNotifier({this.headerWidget, this.bodyWidget, this.collapsed, this.isExpand});
@override
_HeaderBodyExpandableNotifierState createState() =>
_HeaderBodyExpandableNotifierState();
}
class _HeaderBodyExpandableNotifierState
extends State<HeaderBodyExpandableNotifier> {
@override
Widget build(BuildContext context) {
setState(() {
if (widget.isExpand == true) {
widget.expandFlag = widget.isExpand;
widget.controller.expanded = true;
}
});
return ExpandableNotifier(
child: Padding(
padding: const EdgeInsets.only(left: 0, right: 0),
child: Column(
children: <Widget>[
SizedBox(
child: widget.headerWidget,
),
ScrollOnExpand(
scrollOnExpand: true,
scrollOnCollapse: false,
child: ExpandablePanel(
theme: const ExpandableThemeData(
headerAlignment: ExpandablePanelHeaderAlignment.center,
tapBodyToCollapse: true,
),
// header: widget.headerWidget,
collapsed: Container(),
expanded: widget.bodyWidget,
builder: (_, collapsed, expanded) {
return Padding(
padding: EdgeInsets.only(left: 0, right: 0, bottom: 0),
child: Expandable(
controller: widget.controller,
collapsed: collapsed,
expanded: expanded,
theme: const ExpandableThemeData(crossFadePoint: 0),
),
);
},
),
),
],
),
),
);
}
}

@ -7,14 +7,14 @@ packages:
name: _fe_analyzer_shared name: _fe_analyzer_shared
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.0" version: "12.0.0"
analyzer: analyzer:
dependency: transitive dependency: transitive
description: description:
name: analyzer name: analyzer
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.39.8" version: "0.40.6"
archive: archive:
dependency: transitive dependency: transitive
description: description:
@ -49,7 +49,7 @@ packages:
name: bazel_worker name: bazel_worker
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.23+1" version: "0.1.25"
boolean_selector: boolean_selector:
dependency: transitive dependency: transitive
description: description:
@ -63,14 +63,14 @@ packages:
name: build name: build
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.2" version: "1.5.2"
build_config: build_config:
dependency: transitive dependency: transitive
description: description:
name: build_config name: build_config
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.2" version: "0.4.4"
build_daemon: build_daemon:
dependency: transitive dependency: transitive
description: description:
@ -84,35 +84,35 @@ packages:
name: build_modules name: build_modules
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.8.1" version: "3.0.1"
build_resolvers: build_resolvers:
dependency: transitive dependency: transitive
description: description:
name: build_resolvers name: build_resolvers
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.7" version: "1.4.4"
build_runner: build_runner:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: build_runner name: build_runner
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.9.0" version: "1.10.7"
build_runner_core: build_runner_core:
dependency: transitive dependency: transitive
description: description:
name: build_runner_core name: build_runner_core
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.1.0" version: "6.1.2"
build_web_compilers: build_web_compilers:
dependency: "direct dev" dependency: "direct dev"
description: description:
name: build_web_compilers name: build_web_compilers
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.9.0" version: "2.12.2"
built_collection: built_collection:
dependency: transitive dependency: transitive
description: description:
@ -162,6 +162,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.2" version: "1.0.2"
cli_util:
dependency: transitive
description:
name: cli_util
url: "https://pub.dartlang.org"
source: hosted
version: "0.2.0"
clock: clock:
dependency: transitive dependency: transitive
description: description:
@ -175,7 +182,7 @@ packages:
name: code_builder name: code_builder
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.2.1" version: "3.5.0"
collection: collection:
dependency: transitive dependency: transitive
description: description:
@ -189,21 +196,28 @@ packages:
name: connectivity name: connectivity
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.8+2" version: "0.4.9+5"
connectivity_for_web:
dependency: transitive
description:
name: connectivity_for_web
url: "https://pub.dartlang.org"
source: hosted
version: "0.3.1+4"
connectivity_macos: connectivity_macos:
dependency: transitive dependency: transitive
description: description:
name: connectivity_macos name: connectivity_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.0+2" version: "0.1.0+7"
connectivity_platform_interface: connectivity_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: connectivity_platform_interface name: connectivity_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.5" version: "1.0.6"
convert: convert:
dependency: transitive dependency: transitive
description: description:
@ -217,14 +231,7 @@ packages:
name: crypto name: crypto
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.4" version: "2.1.5"
csslib:
dependency: transitive
description:
name: csslib
url: "https://pub.dartlang.org"
source: hosted
version: "0.16.1"
cupertino_icons: cupertino_icons:
dependency: "direct main" dependency: "direct main"
description: description:
@ -238,21 +245,28 @@ packages:
name: dart_style name: dart_style
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.4" version: "1.3.10"
device_info: device_info:
dependency: "direct main" dependency: "direct main"
description: description:
name: device_info name: device_info
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.4.2+4" version: "0.4.2+10"
device_info_platform_interface:
dependency: transitive
description:
name: device_info_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.1"
eva_icons_flutter: eva_icons_flutter:
dependency: "direct main" dependency: "direct main"
description: description:
name: eva_icons_flutter name: eva_icons_flutter
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.1"
expandable: expandable:
dependency: "direct main" dependency: "direct main"
description: description:
@ -267,6 +281,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0-nullsafety.1" version: "1.2.0-nullsafety.1"
ffi:
dependency: transitive
description:
name: ffi
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.3"
file:
dependency: transitive
description:
name: file
url: "https://pub.dartlang.org"
source: hosted
version: "5.2.1"
fixnum: fixnum:
dependency: transitive dependency: transitive
description: description:
@ -304,7 +332,7 @@ packages:
name: flutter_plugin_android_lifecycle name: flutter_plugin_android_lifecycle
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.7" version: "1.0.11"
flutter_test: flutter_test:
dependency: "direct dev" dependency: "direct dev"
description: flutter description: flutter
@ -342,21 +370,14 @@ packages:
name: hexcolor name: hexcolor
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.0.6"
html:
dependency: transitive
description:
name: html
url: "https://pub.dartlang.org"
source: hosted
version: "0.14.0+3"
http: http:
dependency: "direct main" dependency: "direct main"
description: description:
name: http name: http
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.12.1" version: "0.12.2"
http_interceptor: http_interceptor:
dependency: "direct main" dependency: "direct main"
description: description:
@ -384,7 +405,7 @@ packages:
name: imei_plugin name: imei_plugin
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.6" version: "1.2.0"
intl: intl:
dependency: "direct main" dependency: "direct main"
description: description:
@ -405,21 +426,21 @@ packages:
name: js name: js
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.3-nullsafety.1" version: "0.6.2"
json_annotation: json_annotation:
dependency: transitive dependency: transitive
description: description:
name: json_annotation name: json_annotation
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "3.0.1" version: "3.1.1"
local_auth: local_auth:
dependency: "direct main" dependency: "direct main"
description: description:
name: local_auth name: local_auth
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.6.2+1" version: "0.6.3+4"
logging: logging:
dependency: transitive dependency: transitive
description: description:
@ -433,7 +454,7 @@ packages:
name: maps_launcher name: maps_launcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.2.0" version: "1.2.2+2"
matcher: matcher:
dependency: transitive dependency: transitive
description: description:
@ -447,14 +468,14 @@ packages:
name: meta name: meta
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.3.0-nullsafety.4" version: "1.3.0-nullsafety.3"
mime: mime:
dependency: transitive dependency: transitive
description: description:
name: mime name: mime
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.9.6+3" version: "0.9.7"
nested: nested:
dependency: transitive dependency: transitive
description: description:
@ -468,14 +489,14 @@ packages:
name: node_interop name: node_interop
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.3" version: "1.2.1"
node_io: node_io:
dependency: transitive dependency: transitive
description: description:
name: node_io name: node_io
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1+2" version: "1.2.0"
package_config: package_config:
dependency: transitive dependency: transitive
description: description:
@ -490,34 +511,55 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0-nullsafety.1" version: "1.8.0-nullsafety.1"
path_provider_linux:
dependency: transitive
description:
name: path_provider_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+2"
path_provider_platform_interface:
dependency: transitive
description:
name: path_provider_platform_interface
url: "https://pub.dartlang.org"
source: hosted
version: "1.0.4"
path_provider_windows:
dependency: transitive
description:
name: path_provider_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.4+3"
pedantic: pedantic:
dependency: transitive dependency: transitive
description: description:
name: pedantic name: pedantic
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.8.0+1" version: "1.9.2"
percent_indicator: percent_indicator:
dependency: "direct main" dependency: "direct main"
description: description:
name: percent_indicator name: percent_indicator
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.1+1" version: "2.1.8"
permission_handler: permission_handler:
dependency: "direct main" dependency: "direct main"
description: description:
name: permission_handler name: permission_handler
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.0.0+hotfix.5" version: "5.0.1+1"
permission_handler_platform_interface: permission_handler_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: permission_handler_platform_interface name: permission_handler_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.0.0" version: "2.0.1"
platform: platform:
dependency: transitive dependency: transitive
description: description:
@ -531,7 +573,7 @@ packages:
name: plugin_platform_interface name: plugin_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.2" version: "1.0.3"
pool: pool:
dependency: transitive dependency: transitive
description: description:
@ -539,6 +581,13 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.4.0" version: "1.4.0"
process:
dependency: transitive
description:
name: process
url: "https://pub.dartlang.org"
source: hosted
version: "3.0.13"
progress_hud_v2: progress_hud_v2:
dependency: "direct main" dependency: "direct main"
description: description:
@ -552,14 +601,14 @@ packages:
name: protobuf name: protobuf
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.1" version: "1.1.0"
provider: provider:
dependency: "direct main" dependency: "direct main"
description: description:
name: provider name: provider
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "4.0.5+1" version: "4.3.2+3"
pub_semver: pub_semver:
dependency: transitive dependency: transitive
description: description:
@ -580,7 +629,7 @@ packages:
name: quiver name: quiver
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "2.1.3" version: "2.1.5"
scratch_space: scratch_space:
dependency: transitive dependency: transitive
description: description:
@ -594,35 +643,49 @@ packages:
name: shared_preferences name: shared_preferences
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.5.7" version: "0.5.12+4"
shared_preferences_linux:
dependency: transitive
description:
name: shared_preferences_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.2+4"
shared_preferences_macos: shared_preferences_macos:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_macos name: shared_preferences_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.1+7" version: "0.0.1+11"
shared_preferences_platform_interface: shared_preferences_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_platform_interface name: shared_preferences_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.3" version: "1.0.4"
shared_preferences_web: shared_preferences_web:
dependency: transitive dependency: transitive
description: description:
name: shared_preferences_web name: shared_preferences_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.2+4" version: "0.1.2+7"
shared_preferences_windows:
dependency: transitive
description:
name: shared_preferences_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+3"
shelf: shelf:
dependency: transitive dependency: transitive
description: description:
name: shelf name: shelf
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.7.5" version: "0.7.9"
shelf_web_socket: shelf_web_socket:
dependency: transitive dependency: transitive
description: description:
@ -662,7 +725,7 @@ packages:
name: stack_trace name: stack_trace
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.10.0-nullsafety.2" version: "1.10.0-nullsafety.1"
stream_channel: stream_channel:
dependency: transitive dependency: transitive
description: description:
@ -718,28 +781,42 @@ packages:
name: url_launcher name: url_launcher
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "5.4.5" version: "5.7.10"
url_launcher_linux:
dependency: transitive
description:
name: url_launcher_linux
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+4"
url_launcher_macos: url_launcher_macos:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_macos name: url_launcher_macos
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.0.1+5" version: "0.0.1+9"
url_launcher_platform_interface: url_launcher_platform_interface:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_platform_interface name: url_launcher_platform_interface
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.0.6" version: "1.0.9"
url_launcher_web: url_launcher_web:
dependency: transitive dependency: transitive
description: description:
name: url_launcher_web name: url_launcher_web
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "0.1.1+4" version: "0.1.5+1"
url_launcher_windows:
dependency: transitive
description:
name: url_launcher_windows
url: "https://pub.dartlang.org"
source: hosted
version: "0.0.1+3"
vector_math: vector_math:
dependency: transitive dependency: transitive
description: description:
@ -761,6 +838,20 @@ packages:
url: "https://pub.dartlang.org" url: "https://pub.dartlang.org"
source: hosted source: hosted
version: "1.1.0" version: "1.1.0"
win32:
dependency: transitive
description:
name: win32
url: "https://pub.dartlang.org"
source: hosted
version: "1.7.4"
xdg_directories:
dependency: transitive
description:
name: xdg_directories
url: "https://pub.dartlang.org"
source: hosted
version: "0.1.2"
yaml: yaml:
dependency: transitive dependency: transitive
description: description:
@ -769,5 +860,5 @@ packages:
source: hosted source: hosted
version: "2.2.1" version: "2.2.1"
sdks: sdks:
dart: ">=2.10.0-110 <=2.11.0-213.1.beta" dart: ">=2.10.0 <2.11.0"
flutter: ">=1.12.13+hotfix.5 <2.0.0" flutter: ">=1.22.0 <2.0.0"

Loading…
Cancel
Save