diff --git a/lib/config/config.dart b/lib/config/config.dart index 93dfa881..372fab75 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,12 +6,41 @@ const ONLY_DATE = "[0-9/]"; const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; +const GET_PROJECTS = 'Lists.svc/REST/GetProjectForDoctorAPP'; +const GET_PATIENT_VITAL_SIGN = 'Doctors.svc/REST/Doctor_GetPatientVitalSign'; +const GET_PATIENT_LAB_OREDERS = + 'DoctorApplication.svc/REST/GetPatientLabOreders'; +const GET_PRESCRIPTION = 'Patients.svc/REST/GetPrescriptionApptList'; +const GET_RADIOLOGY = 'DoctorApplication.svc/REST/GetPatientRadResult'; //*********change value to decode json from Dropdown ************ - var SERVICES_PATIANT = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; -var SERVICES_PATIANT2 = ["List_MyOutPatient", "List_MyInPatient","List_MyDischargePatient" ,"List_MyReferredPatient","List_MyDischargeReferralPatient","List_MyTomorrowPatient","List_MyReferralPatient"]; -var SERVICES_PATIANT_HEADER = ["OutPatient", "InPatient", "Discharge","Referred","Referral Discharge","Tomorrow","Referral"]; +var SERVICES_PATIANT = [ + "GetMyOutPatient", + "GetMyInPatient", + "GtMyDischargePatient", + "GtMyReferredPatient", + "GtMyDischargeReferralPatient", + "GtMyTomorrowPatient", + "GtMyReferralPatient" +]; +var SERVICES_PATIANT2 = [ + "List_MyOutPatient", + "List_MyInPatient", + "List_MyDischargePatient", + "List_MyReferredPatient", + "List_MyDischargeReferralPatient", + "List_MyTomorrowPatient", + "List_MyReferralPatient" +]; +var SERVICES_PATIANT_HEADER = [ + "OutPatient", + "InPatient", + "Discharge", + "Referred", + "Referral Discharge", + "Tomorrow", + "Referral" +]; //****************** - // Colors ////// by : ibrahim -const PRIMARY_COLOR = 0xff58434F; \ No newline at end of file +const PRIMARY_COLOR = 0xff58434F; diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart index 8a90edf6..fc74bb99 100644 --- a/lib/config/shared_pref_kay.dart +++ b/lib/config/shared_pref_kay.dart @@ -1,4 +1,8 @@ final TOKEN = 'token'; -final PROJECT_ID="projectID"; -final SLECTED_PATIENT_TYPE="slectedPatientType"; -final APP_Language = "language"; \ No newline at end of file +final PROJECT_ID='projectID'; +//===========amjad============ +final DOCTOR_ID='doctorID'; +//======================= +final SLECTED_PATIENT_TYPE='slectedPatientType'; +final APP_Language = 'language'; +final DOCTOR_PROFILE = 'doctorProfile'; \ No newline at end of file diff --git a/lib/models/clinic_model.dart b/lib/models/clinic_model.dart new file mode 100644 index 00000000..e5eb8eee --- /dev/null +++ b/lib/models/clinic_model.dart @@ -0,0 +1,43 @@ +/* + *@author: Elham Rababah + *@Date:17/5/2020 + *@param: + *@return: + *@desc: Clinic Model + */ +class ClinicModel { + Null setupID; + int projectID; + int doctorID; + int clinicID; + bool isActive; + String clinicName; + + ClinicModel( + {this.setupID, + this.projectID, + this.doctorID, + this.clinicID, + this.isActive, + this.clinicName}); + + ClinicModel.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + doctorID = json['DoctorID']; + clinicID = json['ClinicID']; + isActive = json['IsActive']; + clinicName = json['ClinicName']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['DoctorID'] = this.doctorID; + data['ClinicID'] = this.clinicID; + data['IsActive'] = this.isActive; + data['ClinicName'] = this.clinicName; + return data; + } +} diff --git a/lib/models/doctor_profile_model.dart b/lib/models/doctor_profile_model.dart new file mode 100644 index 00000000..17625968 --- /dev/null +++ b/lib/models/doctor_profile_model.dart @@ -0,0 +1,176 @@ +class DoctorProfileModel { + int doctorID; + String doctorName; + Null doctorNameN; + int clinicID; + String clinicDescription; + Null clinicDescriptionN; + Null licenseExpiry; + int employmentType; + Null setupID; + int projectID; + String projectName; + String nationalityID; + String nationalityName; + Null nationalityNameN; + int gender; + String genderDescription; + Null genderDescriptionN; + Null doctorTitle; + Null projectNameN; + bool isAllowWaitList; + String titleDescription; + Null titleDescriptionN; + Null isRegistered; + Null isDoctorDummy; + bool isActive; + Null isDoctorAppointmentDisplayed; + bool doctorClinicActive; + Null isbookingAllowed; + String doctorCases; + Null doctorPicture; + String doctorProfileInfo; + List specialty; + int actualDoctorRate; + String doctorImageURL; + int doctorRate; + String doctorTitleForProfile; + bool isAppointmentAllowed; + String nationalityFlagURL; + int noOfPatientsRate; + String qR; + int serviceID; + + DoctorProfileModel( + {this.doctorID, + this.doctorName, + this.doctorNameN, + this.clinicID, + this.clinicDescription, + this.clinicDescriptionN, + this.licenseExpiry, + this.employmentType, + this.setupID, + this.projectID, + this.projectName, + this.nationalityID, + this.nationalityName, + this.nationalityNameN, + this.gender, + this.genderDescription, + this.genderDescriptionN, + this.doctorTitle, + this.projectNameN, + this.isAllowWaitList, + this.titleDescription, + this.titleDescriptionN, + this.isRegistered, + this.isDoctorDummy, + this.isActive, + this.isDoctorAppointmentDisplayed, + this.doctorClinicActive, + this.isbookingAllowed, + this.doctorCases, + this.doctorPicture, + this.doctorProfileInfo, + this.specialty, + this.actualDoctorRate, + this.doctorImageURL, + this.doctorRate, + this.doctorTitleForProfile, + this.isAppointmentAllowed, + this.nationalityFlagURL, + this.noOfPatientsRate, + this.qR, + this.serviceID}); + + DoctorProfileModel.fromJson(Map json) { + doctorID = json['DoctorID']; + doctorName = json['DoctorName']; + doctorNameN = json['DoctorNameN']; + clinicID = json['ClinicID']; + clinicDescription = json['ClinicDescription']; + clinicDescriptionN = json['ClinicDescriptionN']; + licenseExpiry = json['LicenseExpiry']; + employmentType = json['EmploymentType']; + setupID = json['SetupID']; + projectID = json['ProjectID']; + projectName = json['ProjectName']; + nationalityID = json['NationalityID']; + nationalityName = json['NationalityName']; + nationalityNameN = json['NationalityNameN']; + gender = json['Gender']; + genderDescription = json['Gender_Description']; + genderDescriptionN = json['Gender_DescriptionN']; + doctorTitle = json['DoctorTitle']; + projectNameN = json['ProjectNameN']; + isAllowWaitList = json['IsAllowWaitList']; + titleDescription = json['Title_Description']; + titleDescriptionN = json['Title_DescriptionN']; + isRegistered = json['IsRegistered']; + isDoctorDummy = json['IsDoctorDummy']; + isActive = json['IsActive']; + isDoctorAppointmentDisplayed = json['IsDoctorAppointmentDisplayed']; + doctorClinicActive = json['DoctorClinicActive']; + isbookingAllowed = json['IsbookingAllowed']; + doctorCases = json['DoctorCases']; + doctorPicture = json['DoctorPicture']; + doctorProfileInfo = json['DoctorProfileInfo']; + specialty = json['Specialty'].cast(); + actualDoctorRate = json['ActualDoctorRate']; + doctorImageURL = json['DoctorImageURL']; + doctorRate = json['DoctorRate']; + doctorTitleForProfile = json['DoctorTitleForProfile']; + isAppointmentAllowed = json['IsAppointmentAllowed']; + nationalityFlagURL = json['NationalityFlagURL']; + noOfPatientsRate = json['NoOfPatientsRate']; + qR = json['QR']; + serviceID = json['ServiceID']; + } + + Map toJson() { + final Map data = new Map(); + data['DoctorID'] = this.doctorID; + data['DoctorName'] = this.doctorName; + data['DoctorNameN'] = this.doctorNameN; + data['ClinicID'] = this.clinicID; + data['ClinicDescription'] = this.clinicDescription; + data['ClinicDescriptionN'] = this.clinicDescriptionN; + data['LicenseExpiry'] = this.licenseExpiry; + data['EmploymentType'] = this.employmentType; + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['ProjectName'] = this.projectName; + data['NationalityID'] = this.nationalityID; + data['NationalityName'] = this.nationalityName; + data['NationalityNameN'] = this.nationalityNameN; + data['Gender'] = this.gender; + data['Gender_Description'] = this.genderDescription; + data['Gender_DescriptionN'] = this.genderDescriptionN; + data['DoctorTitle'] = this.doctorTitle; + data['ProjectNameN'] = this.projectNameN; + data['IsAllowWaitList'] = this.isAllowWaitList; + data['Title_Description'] = this.titleDescription; + data['Title_DescriptionN'] = this.titleDescriptionN; + data['IsRegistered'] = this.isRegistered; + data['IsDoctorDummy'] = this.isDoctorDummy; + data['IsActive'] = this.isActive; + data['IsDoctorAppointmentDisplayed'] = this.isDoctorAppointmentDisplayed; + data['DoctorClinicActive'] = this.doctorClinicActive; + data['IsbookingAllowed'] = this.isbookingAllowed; + data['DoctorCases'] = this.doctorCases; + data['DoctorPicture'] = this.doctorPicture; + data['DoctorProfileInfo'] = this.doctorProfileInfo; + data['Specialty'] = this.specialty; + data['ActualDoctorRate'] = this.actualDoctorRate; + data['DoctorImageURL'] = this.doctorImageURL; + data['DoctorRate'] = this.doctorRate; + data['DoctorTitleForProfile'] = this.doctorTitleForProfile; + data['IsAppointmentAllowed'] = this.isAppointmentAllowed; + data['NationalityFlagURL'] = this.nationalityFlagURL; + data['NoOfPatientsRate'] = this.noOfPatientsRate; + data['QR'] = this.qR; + data['ServiceID'] = this.serviceID; + return data; + } +} diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 6e1813fe..2b2fd876 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -51,6 +51,7 @@ class PatiantInformtion { String genderDescription; String nursingStationName; String appointmentDate; + String startTime; PatiantInformtion({ this.list, @@ -87,7 +88,8 @@ class PatiantInformtion { this.genderDescription, this.nursingStationName, this.appointmentDate, - + this.startTime, + }); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( @@ -124,6 +126,7 @@ class PatiantInformtion { genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], appointmentDate: json["AppointmentDate"]?? '', + startTime: json["StartTime"], ); diff --git a/lib/models/patient/patient_model.dart b/lib/models/patient/patient_model.dart index 564f2527..c6f4602d 100644 --- a/lib/models/patient/patient_model.dart +++ b/lib/models/patient/patient_model.dart @@ -1,8 +1,18 @@ + +/* + *@author:Modified by amjad add getter and setter Amjad Amireh + *@Date:11/5/2020 + *@param: + *@return:PatientsScreen Search textbox filter + + *@desc: + */ class PatientModel { int ProjectID; int ClinicID; int DoctorID; String FirstName; + String MiddleName; String LastName; String PatientMobileNumber; @@ -21,13 +31,87 @@ class PatientModel { bool PatientOutSA; - getFirstName() { - return this.FirstName; - } + int get getProjectID => ProjectID; + + set setProjectID(int ProjectID) => this.ProjectID = ProjectID; + + int get getClinicID => ClinicID; + + set setClinicID(int ClinicID) => this.ClinicID = ClinicID; + + int get getDoctorID => DoctorID; + + set setDoctorID(int DoctorID) => this.DoctorID = DoctorID; + String get getFirstName => FirstName; + + set setFirstName(String FirstName) => this.FirstName = FirstName; + + String get getMiddleName => MiddleName; + + set setMiddleName(String MiddleName) => this.MiddleName = MiddleName; + + String get getLastName => LastName; + + set setLastName(String LastName) => this.LastName = LastName; + + String get getPatientMobileNumber => PatientMobileNumber; + + set setPatientMobileNumber(String PatientMobileNumber) => this.PatientMobileNumber = PatientMobileNumber; + +// String get getPatientIdentificationID => PatientIdentificationID; + +// set setPatientIdentificationID(String PatientIdentificationID) => this.PatientIdentificationID = PatientIdentificationID; + + int get getPatientID => PatientID; + + set setPatientID(int PatientID) => this.PatientID = PatientID; + + String get getFrom => From; + + set setFrom(String From) => this.From = From; + + String get getTo => To; + + set setTo(String To) => this.To = To; + + int get getLanguageID => LanguageID; + + set setLanguageID(int LanguageID) => this.LanguageID = LanguageID; + + String get getStamp => stamp; + + set setStamp(String stamp) => this.stamp = stamp; + + String get getIPAdress => IPAdress; + + set setIPAdress(String IPAdress) => this.IPAdress = IPAdress; + + double get getVersionID => VersionID; + + set setVersionID(double VersionID) => this.VersionID = VersionID; + + int get getChannel => Channel; + + set setChannel(int Channel) => this.Channel = Channel; + + String get getTokenID => TokenID; + + set setTokenID(String TokenID) => this.TokenID = TokenID; + + String get getSessionID => SessionID; + + set setSessionID(String SessionID) => this.SessionID = SessionID; + + bool get getIsLoginForDoctorApp => IsLoginForDoctorApp; + + set setIsLoginForDoctorApp(bool IsLoginForDoctorApp) => this.IsLoginForDoctorApp = IsLoginForDoctorApp; + + bool get getPatientOutSA => PatientOutSA; + + set setPatientOutSA(bool PatientOutSA) => this.PatientOutSA = PatientOutSA; + + - setFirstName( FirstName) { - this.FirstName = FirstName; - } diff --git a/lib/models/patient/prescription_res_model.dart b/lib/models/patient/prescription_res_model.dart index 7bb545ee..9c7e296d 100644 --- a/lib/models/patient/prescription_res_model.dart +++ b/lib/models/patient/prescription_res_model.dart @@ -38,7 +38,7 @@ class PrescriptionResModel { String nationalityFlagURL; int noOfPatientsRate; String qR; - List speciality; + List speciality; PrescriptionResModel( {this.setupID, @@ -108,7 +108,7 @@ class PrescriptionResModel { nationalityFlagURL = json['NationalityFlagURL']; noOfPatientsRate = json['NoOfPatientsRate']; qR = json['QR']; - speciality = json['Speciality'].cast(); + speciality = json['Speciality']; } Map toJson() { diff --git a/lib/models/profile_req_Model.dart b/lib/models/profile_req_Model.dart new file mode 100644 index 00000000..6a850811 --- /dev/null +++ b/lib/models/profile_req_Model.dart @@ -0,0 +1,71 @@ +/* + *@author: Elham Rababah + *@Date:17/5/2020 + *@param: + *@return: + *@desc: ProfileReqModel + */ +class ProfileReqModel { + int projectID; + int clinicID; + int doctorID; + bool isRegistered; + bool license; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + + ProfileReqModel( + {this.projectID, + this.clinicID, + this.doctorID, + this.isRegistered =true, + this.license, + this.languageID, + this.stamp = '2020-04-26T09:32:18.317Z', + this.iPAdress='11.11.11.11', + this.versionID=1.2, + this.channel=9, + this.sessionID='E2bsEeYEJo', + this.tokenID, + this.isLoginForDoctorApp = true}); + + ProfileReqModel.fromJson(Map json) { + projectID = json['ProjectID']; + clinicID = json['ClinicID']; + doctorID = json['doctorID']; + isRegistered = json['IsRegistered']; + license = json['License']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['ClinicID'] = this.clinicID; + data['doctorID'] = this.doctorID; + data['IsRegistered'] = this.isRegistered; + data['License'] = this.license; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + return data; + } +} diff --git a/lib/providers/auth_provider.dart b/lib/providers/auth_provider.dart index 5e4877b4..af93c837 100644 --- a/lib/providers/auth_provider.dart +++ b/lib/providers/auth_provider.dart @@ -14,6 +14,7 @@ const SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE = 'Sentry.svc/REST/DoctorApplication_SendActivationCodebyOTPNotificationType'; const MEMBER_CHECK_ACTIVATION_CODE_NEW ='Sentry.svc/REST/MemberCheckActivationCode_New'; +const GET_DOC_PROFILES = 'Doctors.svc/REST/GetDocProfiles'; class AuthProvider with ChangeNotifier { Future login(UserModel userInfo) async { const url = LOGIN_URL; @@ -85,4 +86,23 @@ class AuthProvider with ChangeNotifier { throw error; } } + + /* + *@author: Elham Rababah + *@Date:17/5/2020 + *@param: docInfo + *@return:Future + *@desc: getDocProfiles + */ + Future getDocProfiles(docInfo) async { + const url = GET_DOC_PROFILES; + + try { + final response = await AppClient.post(url, body: json.encode(docInfo)); + return Future.value(json.decode(response.body)); + } catch (error) { + print(error); + throw error; + } + } } diff --git a/lib/providers/hospital_provider.dart b/lib/providers/hospital_provider.dart index 005a53ac..abf758a2 100644 --- a/lib/providers/hospital_provider.dart +++ b/lib/providers/hospital_provider.dart @@ -1,23 +1,11 @@ import 'dart:convert'; +import 'package:doctor_app_flutter/client/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/util/dr_app_shared_pref.dart'; - -import '../interceptor/http_interceptor.dart'; import 'package:flutter/cupertino.dart'; -import 'package:http/http.dart'; -import 'package:http_interceptor/http_client_with_interceptor.dart'; - -const GET_PROJECTS = BASE_URL + 'Lists.svc/REST/GetProjectForDoctorAPP'; class HospitalProvider with ChangeNotifier { - - - Client client = - HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); - Future getProjectsList() async { const url = GET_PROJECTS; var info = { @@ -31,7 +19,7 @@ class HospitalProvider with ChangeNotifier { "IsLoginForDoctorApp": true }; try { - final response = await client.post(url, body: json.encode(info)); + final response = await AppClient.post(url, body: json.encode(info)); return Future.value(json.decode(response.body)); } catch (error) { throw error; diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index 0b63f598..c68e94d0 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -1,28 +1,21 @@ import 'dart:convert'; -import 'package:doctor_app_flutter/models/patient/lab_orders_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; -import 'package:doctor_app_flutter/models/patient/prescription_req_model.dart'; -import 'package:doctor_app_flutter/models/patient/prescription_res_model.dart'; -import 'package:doctor_app_flutter/models/patient/radiology_res_model.dart'; import 'package:flutter/cupertino.dart'; import 'package:http/http.dart'; import 'package:http_interceptor/http_client_with_interceptor.dart'; +import '../client/app_client.dart'; import '../config/config.dart'; import '../interceptor/http_interceptor.dart'; +import '../models/patient/lab_orders_res_model.dart'; +import '../models/patient/patiant_info_model.dart'; import '../models/patient/patient_model.dart'; +import '../models/patient/prescription_res_model.dart'; +import '../models/patient/radiology_res_model.dart'; import '../models/patient/vital_sign_res_model.dart'; - import '../util/helpers.dart'; -const GET_PATIENT_VITAL_SIGN = - BASE_URL + 'Doctors.svc/REST/Doctor_GetPatientVitalSign'; -const GET_PATIENT_LAB_OREDERS = - BASE_URL + 'DoctorApplication.svc/REST/GetPatientLabOreders'; -const GET_PRESCRIPTION = BASE_URL + 'Patients.svc/REST/GetPrescriptionApptList'; -const GET_RADIOLOGY = - BASE_URL + 'DoctorApplication.svc/REST/GetPatientRadResult'; +Helpers helpers = Helpers(); class PatientsProvider with ChangeNotifier { bool isLoading = false; @@ -41,11 +34,12 @@ class PatientsProvider with ChangeNotifier { Future getPatientList(PatientModel patient, patientType) async { /* const url = BASE_URL+'DoctorApplication.svc/REST/GetMyInPatient';*/ - // var srvicePatiant = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; - // print("a=SERVICES_PATIANT[patientType]========='=======a"); + int val = int.parse(patientType); - final url =BASE_URL+"DoctorApplication.svc/REST/"+ SERVICES_PATIANT[val];///"https://uat.hmgwebservices.com/Services/Doctors.svc/REST/"; - //BASE_URL + 'DoctorApplication.svc/REST/' + SERVICES_PATIANT[val]; + //**********Modify url by amjad amireh for patiant type********* + + final url = + BASE_URL + "DoctorApplication.svc/REST/" + SERVICES_PATIANT[val]; // print("a===========$url=======a"); try { @@ -76,8 +70,8 @@ class PatientsProvider with ChangeNotifier { //*********************** return Future.value(json.decode(response.body)); - } catch (error) { - throw error; + } catch (err) { + throw err; } } @@ -100,7 +94,7 @@ class PatientsProvider with ChangeNotifier { try { if (await Helpers.checkConnection()) { - final response = await client.post(GET_PATIENT_VITAL_SIGN, + final response = await AppClient.post(GET_PATIENT_VITAL_SIGN, body: json.encode(patient)); final int statusCode = response.statusCode; isLoading = false; @@ -128,20 +122,11 @@ class PatientsProvider with ChangeNotifier { error = 'Please Check The Internet Connection'; } notifyListeners(); - } catch (error) { - throw error; + } catch (err) { + handelCatchErrorCase(err); } } - PatiantInformtion getSelectedPatient() { - return _selectedPatient; - } - - setSelectedPatient(PatiantInformtion patient) { - // return _selectedPatient; - _selectedPatient = patient; - } - /*@author: Elham Rababah *@Date:27/4/2020 *@param: patient @@ -155,7 +140,7 @@ class PatientsProvider with ChangeNotifier { try { if (await Helpers.checkConnection()) { - final response = await client.post(GET_PATIENT_LAB_OREDERS, + final response = await AppClient.post(GET_PATIENT_LAB_OREDERS, body: json.encode(patient)); final int statusCode = response.statusCode; isLoading = false; @@ -168,7 +153,6 @@ class PatientsProvider with ChangeNotifier { print('$res'); if (res['MessageStatus'] == 1) { patientLabResultOrdersList = []; - print("res['List_GetLabOreders']"); res['List_GetLabOreders'].forEach((v) { patientLabResultOrdersList.add(new LabOrdersResModel.fromJson(v)); }); @@ -183,8 +167,8 @@ class PatientsProvider with ChangeNotifier { error = 'Please Check The Internet Connection'; } notifyListeners(); - } catch (error) { - throw error; + } catch (err) { + handelCatchErrorCase(err); } } @@ -202,7 +186,7 @@ class PatientsProvider with ChangeNotifier { try { if (await Helpers.checkConnection()) { final response = - await client.post(GET_PRESCRIPTION, body: json.encode(patient)); + await AppClient.post(GET_PRESCRIPTION, body: json.encode(patient)); final int statusCode = response.statusCode; isLoading = false; @@ -214,7 +198,6 @@ class PatientsProvider with ChangeNotifier { print('$res'); if (res['MessageStatus'] == 1) { patientPrescriptionsList = []; - print("res['PatientPrescriptionList']"); res['PatientPrescriptionList'].forEach((v) { patientPrescriptionsList .add(new PrescriptionResModel.fromJson(v)); @@ -230,11 +213,25 @@ class PatientsProvider with ChangeNotifier { error = 'Please Check The Internet Connection'; } notifyListeners(); - } catch (error) { - throw error; + } catch (err) { + handelCatchErrorCase(err); } } + /*@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 @@ -248,7 +245,7 @@ class PatientsProvider with ChangeNotifier { try { if (await Helpers.checkConnection()) { final response = - await client.post(GET_RADIOLOGY, body: json.encode(patient)); + await AppClient.post(GET_RADIOLOGY, body: json.encode(patient)); final int statusCode = response.statusCode; isLoading = false; @@ -260,7 +257,6 @@ class PatientsProvider with ChangeNotifier { print('$res'); if (res['MessageStatus'] == 1) { patientRadiologyList = []; - print("res['List_GetRadOreders']"); res['List_GetRadOreders'].forEach((v) { patientRadiologyList.add(new RadiologyResModel.fromJson(v)); }); @@ -275,8 +271,8 @@ class PatientsProvider with ChangeNotifier { error = 'Please Check The Internet Connection'; } notifyListeners(); - } catch (error) { - throw error; + } catch (err) { + handelCatchErrorCase(err); } } } diff --git a/lib/providers/project_provider.dart b/lib/providers/project_provider.dart index abf53ea3..27dced84 100644 --- a/lib/providers/project_provider.dart +++ b/lib/providers/project_provider.dart @@ -18,7 +18,7 @@ class ProjectProvider with ChangeNotifier{ } void loadSharedPrefLanguage() async { currentLanguage = await sharedPref.getString(APP_Language); - _appLocale = Locale(currentLanguage ?? 'ar'); + _appLocale = Locale(currentLanguage ?? 'en'); _isArabic = currentLanguage != null ? currentLanguage == 'ar' ? true : false : false; diff --git a/lib/routes.dart b/lib/routes.dart index dcef9fbe..f2f5f6bb 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,3 +1,5 @@ +import './screens/patients/profile/vital_sign/body_measurements_screen.dart'; + import './screens/QR_reader_screen.dart'; import './screens/auth/change_password_screen.dart'; import './screens/auth/login_screen.dart'; @@ -46,8 +48,7 @@ const String LAB_ORDERS = 'patients/lab_orders'; const String PRESCRIPTIONS = 'patients/prescription'; const String RADIOLOGY = 'patients/radiology'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; - - +const String BODY_MEASUREMENTS = 'patients/body-measurements'; var routes = { HOME: (_) => DashboardScreen(), @@ -63,15 +64,17 @@ var routes = { SETTINGS: (_) => SettingsScreen(), CHANGE_PASSWORD: (_) => ChangePasswordScreen(), VERIFY_ACCOUNT: (_) => VerifyAccountScreen(), - VERIFICATION_METHODS:(_)=> VerificationMethodsScreen(), - PATIENTS_PROFILE:(_)=> PatientProfileScreen(), - PHARMACIES_LIST: (_) => PharmaciesListScreen(itemID: null,), + VERIFICATION_METHODS: (_) => VerificationMethodsScreen(), + PATIENTS_PROFILE: (_) => PatientProfileScreen(), + PHARMACIES_LIST: (_) => PharmaciesListScreen( + itemID: null, + ), VITAL_SIGN: (_) => VitalSignScreen(), MESSAGES: (_) => MessagesScreen(), SERVICES: (_) => ServicesScreen(), - LAB_ORDERS:(_)=>LabOrdersScreen(), - PRESCRIPTIONS:(_)=>PrescriptionScreen(), - RADIOLOGY:(_)=>RadiologyScreen(), - VITAL_SIGN_DETAILS:(_)=>VitalSignDetailsScreen(), - + LAB_ORDERS: (_) => LabOrdersScreen(), + PRESCRIPTIONS: (_) => PrescriptionScreen(), + RADIOLOGY: (_) => RadiologyScreen(), + VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), + BODY_MEASUREMENTS: (_) => BodyMeasurementsScreen() }; diff --git a/lib/screens/auth/login_screen.dart b/lib/screens/auth/login_screen.dart index c203dae9..d8c45a57 100644 --- a/lib/screens/auth/login_screen.dart +++ b/lib/screens/auth/login_screen.dart @@ -72,7 +72,7 @@ class _LoginsreenState extends State { return Text('Error: ${snapshot.error}'); } else { return Container( - margin: EdgeInsetsDirectional.fromSTEB(30, 0, 0, 30), + margin: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 30), alignment: Alignment.topLeft, child: Column( crossAxisAlignment: CrossAxisAlignment.start, diff --git a/lib/screens/auth/verification_methods_screen.dart b/lib/screens/auth/verification_methods_screen.dart index 91fc4713..89193c65 100644 --- a/lib/screens/auth/verification_methods_screen.dart +++ b/lib/screens/auth/verification_methods_screen.dart @@ -46,8 +46,9 @@ class _VerificationMethodsScreenState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AuthHeader(loginType.verificationMethods), - VerificationMethods(changeLoadingStata: - changeLoadingStata,), + VerificationMethods( + changeLoadingStata: changeLoadingStata, + ), ], ), ), diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 2582310a..d79a032a 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -2,6 +2,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.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/helpers.dart'; import 'package:flutter/services.dart'; import '../../config/size_config.dart'; @@ -16,8 +17,10 @@ import 'package:flutter/rendering.dart'; import '../../lookups/patient_lookup.dart'; import '../../widgets/patients/dynamic_elements.dart'; import '../../config/config.dart'; +import '../../models/doctor_profile_model.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); +Helpers helpers = Helpers(); // OWNER : Ibrahim albitar // DATE : 19-04-2020 @@ -31,14 +34,11 @@ class PatientSearchScreen extends StatefulWidget { class _PatientSearchScreenState extends State { String _selectedType = '1'; String _selectedLocation = '1'; - + String error = ''; final GlobalKey _formKey = GlobalKey(); bool _autoValidate = false; var _patientSearchFormValues = PatientModel( - ProjectID: 15, - ClinicID: 0, - DoctorID: 4709, FirstName: "0", MiddleName: "0", LastName: "0", @@ -58,32 +58,47 @@ class _PatientSearchScreenState extends State { PatientOutSA: false); void _validateInputs() async { - print("####IBRAHIM TEST#####" + _patientSearchFormValues.From); - // _patientSearchFormValues.TokenID = + try { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + DoctorProfileModel doctorProfile = + new DoctorProfileModel.fromJson(profile); + if (_formKey.currentState.validate()) { + _formKey.currentState.save(); - if (_formKey.currentState.validate()) { -// If all data are correct then save data to out variables - // _formKey.currentState.save(); - sharedPref.setString(TOKEN,'@dm!n'); - sharedPref.setString(SLECTED_PATIENT_TYPE,_selectedType); - print('_selectedType${_selectedType}'); - String token = await sharedPref.getString(TOKEN); - int projectID = await sharedPref.getInt(PROJECT_ID); - _patientSearchFormValues.TokenID = token; - _patientSearchFormValues.ProjectID = 15;//projectID; - // print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf"); - Navigator.of(context).pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": _selectedType - }); - } else { + //*********************************** */ + sharedPref.setString(TOKEN, '@dm!n'); + sharedPref.setString(SLECTED_PATIENT_TYPE, _selectedType); + print('_selectedType${_selectedType}'); + String token = await sharedPref.getString(TOKEN); + + _patientSearchFormValues.TokenID = token; + _patientSearchFormValues.ProjectID = doctorProfile.projectID ;//15 + _patientSearchFormValues.DoctorID = doctorProfile.doctorID; + _patientSearchFormValues.ClinicID = doctorProfile.clinicID; + + Navigator.of(context).pushNamed(PATIENTS, arguments: { + "patientSearchForm": _patientSearchFormValues, + "selectedType": _selectedType + }); + } else { // If all data are not valid then start auto validation. - setState(() { - _autoValidate = true; - }); + setState(() { + _autoValidate = true; + }); + } + } catch (err) { + handelCatchErrorCase(err); } } + handelCatchErrorCase(err) { + //isLoading = false; + //isError = true; + error = helpers.generateContactAdminMsg(err); + //notifyListeners(); + throw err; + } + @override Widget build(BuildContext context) { return AppScaffold( @@ -173,7 +188,15 @@ class _PatientSearchScreenState extends State { AppTextFormField( hintText: 'First Name', onSaved: (value) { - _patientSearchFormValues.FirstName = value; + value == null + ? _patientSearchFormValues.setFirstName = + "0" + : _patientSearchFormValues.setFirstName = + value; + + if (value.toString().trim().isEmpty) { + _patientSearchFormValues.setFirstName = "0"; + } }, // validator: (value) { // return TextValidator().validateName(value); @@ -185,7 +208,14 @@ class _PatientSearchScreenState extends State { AppTextFormField( hintText: 'Middle Name', onSaved: (value) { - _patientSearchFormValues.MiddleName = value; + value == null + ? _patientSearchFormValues.setMiddleName = + "0" + : _patientSearchFormValues.setMiddleName = + value; + if (value.toString().trim().isEmpty) { + _patientSearchFormValues.setMiddleName = "0"; + } }, // validator: (value) { // return TextValidator().validateName(value); @@ -197,7 +227,13 @@ class _PatientSearchScreenState extends State { AppTextFormField( hintText: 'Last Name', onSaved: (value) { - _patientSearchFormValues.LastName = value; + value == null + ? _patientSearchFormValues.setLastName = "0" + : _patientSearchFormValues.setLastName = + value; + if (value.toString().trim().isEmpty) { + _patientSearchFormValues.setLastName = "0"; + } }, // validator: (value) { // return TextValidator().validateName(value); @@ -214,8 +250,16 @@ class _PatientSearchScreenState extends State { // }, inputFormatter: ONLY_NUMBERS, onSaved: (value) { - _patientSearchFormValues.PatientMobileNumber = - value; + value == null + ? _patientSearchFormValues + .setPatientMobileNumber = "0" + : _patientSearchFormValues + .setPatientMobileNumber = value; + + if (value.toString().trim().isEmpty) { + _patientSearchFormValues + .setPatientMobileNumber = "0"; + } }, ), SizedBox( @@ -227,7 +271,15 @@ class _PatientSearchScreenState extends State { // inputFormatter: ONLY_NUMBERS, onSaved: (value) { - _patientSearchFormValues.PatientID = 89000; + // _patientSearchFormValues.PatientID = 89000; + + value == null + ? _patientSearchFormValues.setPatientID = 0 + : _patientSearchFormValues.setPatientID = + int.parse(value); + if (value.toString().trim().isEmpty) { + _patientSearchFormValues.setPatientID = 0; + } }), SizedBox( height: 10, diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 979c4158..e3bb2908 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/routes.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/errors/dr_app_embedded_error.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; @@ -201,8 +202,24 @@ class _PatientsScreenState extends State { return newDate.toString(); } + convertDateFormat2(String str) { + String timeConvert; + const start = "/Date("; + const end = "+0300)"; + + final startIndex = str.indexOf(start); + final endIndex = str.indexOf(end, startIndex + start.length); + var date = new DateTime.fromMillisecondsSinceEpoch( + int.parse(str.substring(startIndex + start.length, endIndex))); + String newDate = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0'); + return newDate.toString(); + } filterBooking(String str) { this.responseModelList = this.responseModelList2; @@ -231,27 +248,26 @@ class _PatientsScreenState extends State { } } - String checkDate(String dateString) { - String date; DateTime checkedTime = DateTime.parse(dateString); DateTime currentTime = DateTime.now(); if ((currentTime.year == checkedTime.year) && (currentTime.month == checkedTime.month) && (currentTime.day == checkedTime.day)) { - return "TODAY"; + return "Today"; } else if ((currentTime.year == checkedTime.year) && (currentTime.month == checkedTime.month)) { if ((currentTime.day - checkedTime.day) == 1) { return "YESTERDAY"; } else if ((currentTime.day - checkedTime.day) == -1) { - return "TOMORROW"; + return "Tomorrow"; } + if ((currentTime.day - checkedTime.day) <= -2) { return "Next Week"; } else { - return "Old Date"; + return "Old Date"; } } return "Old Date"; @@ -268,114 +284,120 @@ class _PatientsScreenState extends State { body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? Center( - child: Text( - patientsProv.error, - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) - : Container( - - child: ListView(scrollDirection: Axis.vertical, children: < - Widget>[ - Container( - child: litems == null - ? Column( - children: [ - Container( - child: Center( - child: - DrAppCircularProgressIndeicator()), - ), - Container( - child: Text( - "Sorry There is No Data", - style: TextStyle( - color: Theme.of(context).errorColor), - ), + ? DrAppEmbeddedError(error: patientsProv.error) + : litems == null + ? DrAppEmbeddedError( + error: 'You don\'t have any ' + + patientTypetitle + + " patiant") + : Container( + child: + ListView(scrollDirection: Axis.vertical, children: < + Widget>[ + Container( + child: litems == null + ? Column( + children: [ + Container( + child: Center( + child: Padding( + padding: const EdgeInsets.fromLTRB( + 0, 250, 0, 0), + child: + DrAppCircularProgressIndeicator(), + )), + ), + ], ) - ], - ) - : Column( - children: [ - Padding( - padding: EdgeInsets.only( - top: - MediaQuery.of(context).size.height * + : Column( + children: [ + Padding( + padding: EdgeInsets.only( + top: MediaQuery.of(context) + .size + .height * 0.03), - child: SERVICES_PATIANT2[ - int.parse(patientType)] == - "List_MyOutPatient" - ? _locationBar(context) - : Container(), - ), - SizedBox(height: 10.0), - Container( - width: SizeConfig.screenWidth * 0.80, - child: TextField( - controller: _controller, - onChanged: (String str) { - - this.searchData(str); - }, - decoration: buildInputDecoration( - context, 'Search patiant'), - ), - ), - Container( - margin: EdgeInsets.fromLTRB(15, 0, 15, 0), - child: Column( - children: responseModelList - .map((PatiantInformtion item) { - return InkWell( - child: CardWithBgWidget( - widget: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - item.firstName + - " " + - item.lastName + - "- " + - item.patientId.toString(), - fontSize: 2.5 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 8, - ), - SERVICES_PATIANT2[int.parse( - patientType)] == - "List_MyOutPatient" - ? AppText( - convertDate(item - .appointmentDate - .toString()), - fontSize: 2.5 * - SizeConfig - .textMultiplier) - : AppText( - item.nationalityName, - fontSize: 2.5 * - SizeConfig - .textMultiplier) - ], - ), - ), - onTap: () { - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: {"patient": item}); + child: SERVICES_PATIANT2[ + int.parse(patientType)] == + "List_MyOutPatient" + ? _locationBar(context) + : Container(), + ), + SizedBox(height: 10.0), + Container( + width: SizeConfig.screenWidth * 0.80, + child: TextField( + controller: _controller, + onChanged: (String str) { + this.searchData(str); }, - ); - }).toList(), - ), - ), - ], - )) - ]))); + decoration: buildInputDecoration( + context, 'Search patiant'), + ), + ), + Container( + margin: + EdgeInsets.fromLTRB(15, 0, 15, 0), + child: Column( + children: responseModelList + .map((PatiantInformtion item) { + return InkWell( + child: CardWithBgWidget( + widget: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + item.firstName + + " " + + item.lastName + + "- " + + item.patientId + .toString(), + fontSize: 2.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold, + ), + SizedBox( + height: 8, + ), + SERVICES_PATIANT2[int.parse( + patientType)] == + "List_MyOutPatient" + ? AppText( + + convertDateFormat2(item + .appointmentDate + .toString())+" "+"-"+" "+item.startTime + , + fontSize: 2.5 * + SizeConfig + .textMultiplier) + : AppText( + item + .nationalityName, + fontSize: 2.5 * + SizeConfig + .textMultiplier) + ], + ), + ), + onTap: () { + Navigator.of(context).pushNamed( + PATIENTS_PROFILE, + arguments: { + "patient": item + }); + }, + ); + }).toList(), + ), + ), + ], + )) + ]))); } //***********amjad update**buildInputDecoration ***to search box******** @@ -418,15 +440,12 @@ class _PatientsScreenState extends State { fontWeight: FontWeight.bold), ), onTap: () { - print(_locations.indexOf(item)); - filterBooking(item.toString()); setState(() { _activeLocation = _locations.indexOf(item); - }); }), _isActive diff --git a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart index d26ab4c7..ae2bc1d8 100644 --- a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart +++ b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -78,19 +79,9 @@ class _LabOrdersScreenState extends State { body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? Center( - child: Text( - patientsProv.error, - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.patientLabResultOrdersList.length == 0 - ? Center( - child: Text( - 'You don\'t have any Orders', - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: 'You don\'t have any Orders') : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, diff --git a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart index 47fff706..3bded248 100644 --- a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart +++ b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart @@ -12,6 +12,7 @@ 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 '../../../../widgets/shared/errors/dr_app_embedded_error.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -78,19 +79,10 @@ class _PrescriptionScreenState extends State { body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? Center( - child: Text( - patientsProv.error, - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.patientPrescriptionsList.length == 0 - ? Center( - child: Text( - 'You don\'t have any Prescriptions', - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError( + error: 'You don\'t have any Prescriptions') : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, diff --git a/lib/screens/patients/profile/radiology/radiology_screen.dart b/lib/screens/patients/profile/radiology/radiology_screen.dart index 8b48e88c..e5dd68f7 100644 --- a/lib/screens/patients/profile/radiology/radiology_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -78,19 +79,9 @@ class _RadiologyScreenState extends State { body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? Center( - child: Text( - patientsProv.error, - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.patientRadiologyList.length == 0 - ? Center( - child: Text( - 'You don\'t have any Vital Sign', - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign') : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, @@ -120,11 +111,12 @@ class _RadiologyScreenState extends State { CrossAxisAlignment.start, children: [ AppText( - '${patientsProv.patientRadiologyList[index].doctorName}', - fontSize: 2.5 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.bold - ), + '${patientsProv.patientRadiologyList[index].doctorName}', + fontSize: 2.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold), SizedBox( height: 8, ), @@ -132,7 +124,6 @@ class _RadiologyScreenState extends State { 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', fontSize: 2 * SizeConfig.textMultiplier, - ), SizedBox( height: 8, diff --git a/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart b/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart new file mode 100644 index 00000000..bf89edac --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart @@ -0,0 +1,143 @@ +import 'package:charts_flutter/flutter.dart' as charts; +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/vital_sign_res_model.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; + +class BodyMeasurementsScreen extends StatelessWidget { + BodyMeasurementsScreen(); + List vitalList; + @override + Widget build(BuildContext context) { + _seriesData = List>(); + _seriesPieData = List>(); + _seriesLineData = List>(); + _generateData(); + return AppScaffold( + appBarTitle: 'Body Measurements', + body: RoundedContainer( + height: SizeConfig.realScreenHeight*0.4, + child: Padding( + padding: EdgeInsets.all(8.0), + child: Container( + child: Center( + child: Column( + children: [ + Text( + 'Body Mass Index', + style: TextStyle( + fontSize: 24.0, fontWeight: FontWeight.bold), + ), + Expanded( + child: charts.BarChart( + _seriesData, + animate: true, + barGroupingType: charts.BarGroupingType.grouped, + // behaviors: [new charts.SeriesLegend()], + // primaryMeasureAxis: , + animationDuration: Duration(seconds: 5), + ), + ), + ], + ), + ), + ), + ), + ), + ); + } + + List> _seriesData; + List> _seriesPieData; + List> _seriesLineData; + + _generateData() { + var data1 = [ + new Pollution(1980, 'USA', 40), + ]; + + + _seriesData.add( + charts.Series( + domainFn: (Pollution pollution, _) => '', + measureFn: (Pollution pollution, _) => pollution.quantity, + id: '2017', + data: data1, + fillPatternFn: (_, __) => charts.FillPatternType.solid, + fillColorFn: (Pollution pollution, _) => + charts.ColorUtil.fromDartColor(Color(0xff990099)), + ), + ); + _seriesData.add( + charts.Series( + domainFn: (Pollution pollution, _) => '', + measureFn: (Pollution pollution, _) => pollution.quantity, + id: '2017', + data: data1, + fillPatternFn: (_, __) => charts.FillPatternType.solid, + fillColorFn: (Pollution pollution, _) => + charts.ColorUtil.fromDartColor(Color(0xff990099)), + ), + ); + _seriesData.add( + charts.Series( + domainFn: (Pollution pollution, _) => '', + measureFn: (Pollution pollution, _) => pollution.quantity, + id: '2017', + data: data1, + fillPatternFn: (_, __) => charts.FillPatternType.solid, + fillColorFn: (Pollution pollution, _) => + charts.ColorUtil.fromDartColor(Color(0xff990099)), + ), + ); + _seriesData.add( + charts.Series( + domainFn: (Pollution pollution, _) => '', + measureFn: (Pollution pollution, _) => pollution.quantity, + id: '2017', + data: data1, + fillPatternFn: (_, __) => charts.FillPatternType.solid, + fillColorFn: (Pollution pollution, _) => + charts.ColorUtil.fromDartColor(Color(0xff990099)), + ), + ); + _seriesData.add( + charts.Series( + domainFn: (Pollution pollution, _) => '', + measureFn: (Pollution pollution, _) => pollution.quantity, + id: '2017', + data: data1, + fillPatternFn: (_, __) => charts.FillPatternType.solid, + fillColorFn: (Pollution pollution, _) => + charts.ColorUtil.fromDartColor(Color(0xff990099)), + ), + ); + + + + } +} + +class Pollution { + String place; + int year; + int quantity; + + Pollution(this.year, this.place, this.quantity); +} + +class Task { + String task; + double taskvalue; + Color colorval; + + Task(this.task, this.taskvalue, this.colorval); +} + +class Sales { + int yearval; + int salesval; + + Sales(this.yearval, this.salesval); +} diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index bf4aad6b..a7155e01 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/routes.dart'; import 'package:flutter/material.dart'; import '../../../../config/size_config.dart'; @@ -10,7 +11,7 @@ class VitalSignDetailsScreen extends StatelessWidget { // VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key); VitalSignResModel vitalSing; String url = "assets/images/"; - final double contWidth = SizeConfig.realScreenWidth * 0.70; + final double contWidth = SizeConfig.realScreenWidth * 0.70; @override Widget build(BuildContext context) { @@ -19,7 +20,7 @@ class VitalSignDetailsScreen extends StatelessWidget { return AppScaffold( appBarTitle: "vital Sing ", body: RoundedContainer( - height: SizeConfig.realScreenHeight *0.7, + height: SizeConfig.realScreenHeight * 0.7, child: CustomScrollView( primary: false, slivers: [ @@ -31,18 +32,22 @@ class VitalSignDetailsScreen extends StatelessWidget { mainAxisSpacing: 0, crossAxisCount: 3, children: [ + InkWell( + onTap: (){ + Navigator.of(context).pushNamed(BODY_MEASUREMENTS); + }, + child: CircleAvatarWidget( + des: 'Body Measurements', + url: url + 'heartbeat.png', + ), + ), CircleAvatarWidget( - des: 'Body Measurements', - url: url + 'heartbeat.png', - - ), CircleAvatarWidget( des: 'Temperature', url: url + 'heartbeat.png', ), CircleAvatarWidget( des: 'Pulse', url: url + 'heartbeat.png', - ), CircleAvatarWidget( des: 'Respiration', @@ -52,10 +57,11 @@ class VitalSignDetailsScreen extends StatelessWidget { des: 'Blood Pressure', url: url + 'heartbeat.png', ), - CircleAvatarWidget( + CircleAvatarWidget( des: 'Oxygenation', url: url + 'heartbeat.png', - ), CircleAvatarWidget( + ), + CircleAvatarWidget( des: 'Pain Scale', url: url + 'heartbeat.png', ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart index 570a5aa1..8b08f8ac 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart @@ -1,4 +1,5 @@ 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'; @@ -81,19 +82,9 @@ class _VitalSignScreenState extends State { body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? Center( - child: Text( - patientsProv.error, - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.patientVitalSignList.length == 0 - ? Center( - child: Text( - 'You don\'t have any Vital Sign', - style: TextStyle(color: Theme.of(context).errorColor), - ), - ) + ? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign') : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, @@ -151,7 +142,11 @@ class _VitalSignScreenState extends State { ), ), onTap: () { - Navigator.of(context).pushNamed(VITAL_SIGN_DETAILS,arguments: {'vitalSing':patientsProv.patientVitalSignList[index]}); + Navigator.of(context) + .pushNamed(VITAL_SIGN_DETAILS, arguments: { + 'vitalSing': + patientsProv.patientVitalSignList[index] + }); }, ); }), diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index a0a54c72..2065ea57 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -48,7 +48,7 @@ class Helpers { children: items.map((item) { return Text( '${item["$decKey"]}', - style: TextStyle(fontSize: 20), + style: TextStyle(fontSize: SizeConfig.textMultiplier *3), ); }).toList(), @@ -70,7 +70,7 @@ class Helpers { *@desc: showErrorToast */ showErrorToast([msg = null]) { - String localMsg = 'Something wrong happened, please contact the admin'; + String localMsg = generateContactAdminMsg(); if (msg != null) { localMsg = msg.toString(); @@ -96,4 +96,22 @@ class Helpers { return false; } } +/* + *@author: Elham Rababah + *@Date:12/5/2020 + *@param: + *@return: String + *@desc: generate Contact Admin Msg + */ +generateContactAdminMsg([err = null]) { + String localMsg = 'Something wrong happened, please contact the admin'; + if (err != null) { + localMsg = localMsg +'\n \n'+ err.toString(); + } + return localMsg; + } + +} + + diff --git a/lib/widgets/auth/auth_header.dart b/lib/widgets/auth/auth_header.dart index ef507fd6..5fced98d 100644 --- a/lib/widgets/auth/auth_header.dart +++ b/lib/widgets/auth/auth_header.dart @@ -23,7 +23,7 @@ class AuthHeader extends StatelessWidget { children: [ Container( margin: SizeConfig.isMobile - ? EdgeInsetsDirectional.fromSTEB(0, 50, 0, 0) + ? EdgeInsetsDirectional.fromSTEB(0, SizeConfig.realScreenHeight*0.03, 0, 0) : EdgeInsetsDirectional.fromSTEB( SizeConfig.realScreenWidth * 0.13, 0, 0, 0), child: buildImageLogo(), diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index 0cdbd931..f701d554 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -1,4 +1,7 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/models/clinic_model.dart'; +import 'package:doctor_app_flutter/models/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/models/profile_req_Model.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -32,6 +35,7 @@ class _VerifyAccountState extends State { }; Future _loggedUserFuture; var _loggedUser; + AuthProvider authProv; @override void initState() { super.initState(); @@ -46,7 +50,7 @@ class _VerifyAccountState extends State { @override Widget build(BuildContext context) { - AuthProvider authProv = Provider.of(context); + authProv = Provider.of(context); return FutureBuilder( future: Future.wait([_loggedUserFuture]), @@ -200,6 +204,7 @@ class _VerifyAccountState extends State { } return null; } + /* *@author: Elham Rababah *@Date:28/4/2020 @@ -256,7 +261,7 @@ class _VerifyAccountState extends State { *@return: *@desc: verify Account func call sendActivationCodeByOtpNotificationType service */ - verifyAccount(AuthProvider authProv, Function changeLoadingStata) async{ + verifyAccount(AuthProvider authProv, Function changeLoadingStata) async { if (verifyAccountForm.currentState.validate()) { changeLoadingStata(true); @@ -285,11 +290,22 @@ class _VerifyAccountState extends State { changeLoadingStata(true); authProv.memberCheckActivationCodeNew(model).then((res) { - changeLoadingStata(false); + // changeLoadingStata(false); if (res['MessageStatus'] == 1) { sharedPref.setString(TOKEN, res['AuthenticationTokenID']); - Navigator.of(context).pushNamed(HOME); + if (res['List_DoctorProfile'] != null) { + loginProcessCompleted(res['List_DoctorProfile'][0],changeLoadingStata); + } else { + _asyncSimpleDialog(context, res['List_DoctorsClinic'], 'ClinicName', + 'Please Select Clinic') + .then((clinicInfo) { + ClinicModel clinic = ClinicModel.fromJson(clinicInfo); + print(clinicInfo); + getDocProfiles(clinic, changeLoadingStata); + }); + } } else { + changeLoadingStata(false); helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { @@ -302,4 +318,68 @@ class _VerifyAccountState extends State { // changeLoadingStata(false); } } + + + /* + *@author: Elham Rababah + *@Date:17/5/2020 + *@param: Map profile, Function changeLoadingStata + *@return: + *@desc: loginProcessCompleted + */ + loginProcessCompleted(Map profile, Function changeLoadingStata) { + changeLoadingStata(false); + sharedPref.setObj(DOCTOR_PROFILE, profile); + Navigator.of(context).pushNamed(HOME); + } + + Future _asyncSimpleDialog( + BuildContext context, List list, String txtKey, + [String text = '']) async { + return await showDialog( + context: context, + barrierDismissible: true, + builder: (BuildContext context) { + return SimpleDialog( + title: Text(text), + children: list.map((value) { + return SimpleDialogOption( + onPressed: () { + Navigator.pop(context, + value); //here passing the index to be return on item selection + }, + child: Text(value[txtKey]), //item value + ); + }).toList(), + ); + }); + } + + /* + *@author: Elham Rababah + *@Date:17/5/2020 + *@param: ClinicModel clinicInfo, Function changeLoadingStata + *@return: + *@desc: getDocProfiles + */ + getDocProfiles(ClinicModel clinicInfo, Function changeLoadingStata) { + ProfileReqModel docInfo = new ProfileReqModel( + doctorID: clinicInfo.doctorID, + clinicID: clinicInfo.clinicID, + license: true, + projectID: clinicInfo.projectID, + tokenID: '', + languageID: 2); + authProv.getDocProfiles(docInfo).then((res) { + if (res['MessageStatus'] == 1) { + print("DoctorProfileList ${res['DoctorProfileList'][0]}"); + loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata); + } else { + changeLoadingStata(false); + helpers.showErrorToast(res['ErrorEndUserMessage']); + } + }).catchError((err) { + print('$err'); + }); + } } diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 4c8ac7e9..462f76ef 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -57,7 +58,7 @@ class _VerificationMethodsState extends State { return Text('Error: ${snapshot.error}'); } else { return Container( - width: SizeConfig.realScreenWidth * 0.90, + width: SizeConfig.realScreenWidth * 0.80, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -68,55 +69,54 @@ class _VerificationMethodsState extends State { ), ), SizedBox( - height: 40, + height: 20, ), Container( - width: SizeConfig.realScreenWidth * 80, - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: spaceBetweenMethods, - children: [ - buildVerificationMethod( - context, - 'assets/images/verification_fingerprint_icon.png', - 'Fingerprint', - () {}), - buildVerificationMethod( - context, - 'assets/images/verification_faceid_icon.png', - 'Face ID', - () {}), - ], + height: SizeConfig.realScreenHeight * 0.6, + child: CustomScrollView( + primary: false, + slivers: [ + SliverPadding( + padding: const EdgeInsets.all(0), + sliver: SliverGrid.count( + // childAspectRatio: 0.7, + crossAxisSpacing: 0, + mainAxisSpacing: 5, + crossAxisCount: 2, + children: [ + buildVerificationMethod( + context, + 'assets/images/verification_fingerprint_icon.png', + 'Fingerprint', + () {}), + buildVerificationMethod( + context, + 'assets/images/verification_faceid_icon.png', + 'Face ID', + () {}), + buildVerificationMethod( + context, + 'assets/images/verification_whatsapp_icon.png', + 'WhatsApp', () { + sendActivationCodeByOtpNotificationType( + 2, authProv); + }), + buildVerificationMethod( + context, + 'assets/images/verification_sms_icon.png', + 'SMS', () { + sendActivationCodeByOtpNotificationType( + 1, authProv); + }), + ], + ), ), - SizedBox( - height: 40, - ), - Row( - mainAxisAlignment: spaceBetweenMethods, - children: [ - buildVerificationMethod( - context, - 'assets/images/verification_whatsapp_icon.png', - 'WhatsApp', () { - sendActivationCodeByOtpNotificationType( - 2, authProv); - }), - buildVerificationMethod( - context, - 'assets/images/verification_sms_icon.png', - 'SMS', () { - sendActivationCodeByOtpNotificationType( - 1, authProv); - }), - ], - ) ], ), + // height: 500, ), - SizedBox( - height: SizeConfig.heightMultiplier * 2, + SizedBox( + // height: 20, ) ], ), @@ -126,41 +126,43 @@ class _VerificationMethodsState extends State { }); } - InkWell buildVerificationMethod(context, url, dec, Function fun) { - return InkWell( - onTap: fun, - child: Container( - // height: SizeConfig.heightMultiplier *2, - height: SizeConfig.heightMultiplier * 19, - width: SizeConfig.widthMultiplier * 37, + Center buildVerificationMethod(context, url, dec, Function fun) { + return Center( + child: InkWell( + onTap: fun, + child: Container( + // height: SizeConfig.heightMultiplier *2, + height: SizeConfig.heightMultiplier * 19, + width: SizeConfig.widthMultiplier * 37, - padding: EdgeInsets.all(10), - decoration: BoxDecoration( - border: Border.all( - width: 1, - color: Hexcolor( - '#CCCCCC') // <--- border width here + padding: EdgeInsets.all(10), + decoration: BoxDecoration( + border: Border.all( + width: 1, + color: Hexcolor( + '#CCCCCC') // <--- border width here + ), + borderRadius: BorderRadius.all(Radius.circular(10))), + child: Column( + children: [ + Container( + margin: EdgeInsetsDirectional.only( + top: SizeConfig.heightMultiplier * 0.5), + child: Image.asset( + url, + height: SizeConfig.heightMultiplier * 11, + fit: BoxFit.cover, ), - borderRadius: BorderRadius.all(Radius.circular(10))), - child: Column( - children: [ - Container( - margin: EdgeInsetsDirectional.only( - top: SizeConfig.heightMultiplier * 0.5), - child: Image.asset( - url, - height: SizeConfig.heightMultiplier * 10, - fit: BoxFit.cover, ), - ), - SizedBox( - height: 10, - ), - Text( - dec, - style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), - ) - ], + SizedBox( + height: 10, + ), + Text( + dec, + style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), + ) + ], + ), ), ), ); @@ -180,7 +182,7 @@ class _VerificationMethodsState extends State { Map model = { "LogInTokenID": _loggedUser['LogInTokenID'], "Channel": 9, - "MobileNumber": 785228065,//_loggedUser['MobileNumber'], + "MobileNumber": 785228065, //_loggedUser['MobileNumber'], "IPAdress": "11.11.11.11", "LanguageID": 2, "ProjectID": 15, //TODO : this should become daynamci diff --git a/lib/widgets/patients/dynamic_elements.dart b/lib/widgets/patients/dynamic_elements.dart index f8e3e6ac..8b6fc5a8 100644 --- a/lib/widgets/patients/dynamic_elements.dart +++ b/lib/widgets/patients/dynamic_elements.dart @@ -50,35 +50,61 @@ class _DynamicElementsState extends State { AppTextFormField( textInputType: TextInputType.number, hintText: 'From', - controller: _fromDateController, - // validator: (value) { - // return TextValidator().validateDate(_fromDateController.text); - // }, + controller: _fromDateController, //_fromDateController, + inputFormatter: ONLY_DATE, onTap: () { _presentDatePicker('_selectedFromDate'); }, + + // validator: (value) { + // return TextValidator().validateDate(_fromDateController.text); + // }, + /* + *@author: Amjad Amireh + *@Date:13/5/2020 + *@param: + *@return:check if field empty added static value + + *@desc: + */ onSaved: (value) { - widget._patientSearchFormValues.From = _fromDateController.text; + if (_fromDateController.text.toString().trim().isEmpty) { + widget._patientSearchFormValues.From = "0"; + } else { + widget._patientSearchFormValues.From = + _fromDateController.text; + } }, ), - SizedBox( height: 10, ), AppTextFormField( textInputType: TextInputType.number, hintText: 'TO', - controller: _toDateController, + controller: _fromDateController, //_toDateController, onTap: () { _presentDatePicker('_selectedToDate'); }, // validator: (value) { // return TextValidator().validateDate(_toDateController.text); // }, + /* + *@author: Amjad Amireh + *@Date:13/5/2020 + *@param: + *@return:check if field empty added static value + + *@desc: + */ inputFormatter: ONLY_DATE, onSaved: (value) { - widget._patientSearchFormValues.To = _toDateController.text; + if (_toDateController.text.toString().trim().isEmpty) { + widget._patientSearchFormValues.To = "0"; + } else { + widget._patientSearchFormValues.To = _toDateController.text; + } }, ), ], diff --git a/lib/widgets/patients/profile/profile_header_widget.dart b/lib/widgets/patients/profile/profile_header_widget.dart index a745cf88..4aa9f92b 100644 --- a/lib/widgets/patients/profile/profile_header_widget.dart +++ b/lib/widgets/patients/profile/profile_header_widget.dart @@ -1,9 +1,6 @@ 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:hexcolor/hexcolor.dart'; -import 'package:provider/provider.dart'; import '../../../config/size_config.dart'; import '../../shared/profile_image_widget.dart'; diff --git a/lib/widgets/shared/errors/dr_app_embedded_error.dart b/lib/widgets/shared/errors/dr_app_embedded_error.dart new file mode 100644 index 00000000..6bac4a2c --- /dev/null +++ b/lib/widgets/shared/errors/dr_app_embedded_error.dart @@ -0,0 +1,28 @@ +import 'package:flutter/material.dart'; + +/* + *@author: Elham Rababah + *@Date:12/5/2020 + *@param: error + *@return: StatelessWidget + *@desc: DrAppEmbeddedError class + */ +class DrAppEmbeddedError extends StatelessWidget { + const DrAppEmbeddedError({ + Key key, + @required this.error, + }) : super(key: key); + + final String error; + + @override + Widget build(BuildContext context) { + return Center( + child: Text( + error, + style: TextStyle(color: Theme.of(context).errorColor), + textAlign: TextAlign.center, + ), + ); + } +} \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index e7a0a0b1..f87e1480 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -35,6 +35,7 @@ dependencies: connectivity: ^0.4.8+2 maps_launcher: ^1.2.0 url_launcher: ^5.4.5 + charts_flutter: ^0.9.0 # Qr code Scanner barcode_scan: ^3.0.1