diff --git a/.gitignore b/.gitignore index 6b5418ff..ebdaebb7 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,5 @@ lib/generated_plugin_registrant.dart .vscode/settings.json .vscode/settings.json .vscode/settings.json +.vscode/settings.json +.vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 501a6f1f..e592e48b 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "commentBox.styles": { "defaultStyle": { - "commentStartToken": "/* \n *@author: ibrahim albitar \n *@Date:27/4/2020 \n *@param: \n *@return:\n *@desc: ", + "commentStartToken": "/* \n *@author: Amjad Amireh \n *@Date:27/4/2020 \n *@param: \n *@return:\n *@desc: ", "commentEndToken": "\n */", "leftEdgeToken": " * ", "rightEdgeToken": "", diff --git a/lib/config/config.dart b/lib/config/config.dart index c0e8b511..8ebef939 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -6,12 +6,19 @@ 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 PATIENT_PROGRESS_NOTE_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; +const PATIENT_INSURANCE_APPROVALS_URL = "DoctorApplication.svc/REST/GetApprovalStatusForInpatient"; +const PATIENT_ORDERS_URL = "DoctorApplication.svc/REST/GetProgressNoteForInPatient"; + 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'; + +var selectedPatientType = 0; + //*********change value to decode json from Dropdown ************ var SERVICES_PATIANT = [ "GetMyOutPatient", diff --git a/lib/models/patient/insurance_aprovals_request.dart b/lib/models/patient/insurance_aprovals_request.dart new file mode 100644 index 00000000..b94b9b9b --- /dev/null +++ b/lib/models/patient/insurance_aprovals_request.dart @@ -0,0 +1,87 @@ +/* + *@author: Ibrahim Albitar + *@Date:15/5/2020 + + *@param: + {"PatientID":1089227, + "PatientTypeID":1, + "EXuldAPPNO":0, + "ProjectID":12, + "LanguageID":2, + "stamp":"2020-04-01T09:47:19.643Z", + "IPAdress":"11.11.11.11", + "VersionID":1.2, + "Channel":9, + "TokenID":"yIwh6wNyUkOeQlJRohWjyw==", + "SessionID":"LlBk8lUEJY", + "IsLoginForDoctorApp":true, + "PatientOutSA":false} + + *@return: + *@desc: + */ +class InsuranceAprovalsRequest { + int exuldAppNO; + int patientID; + int channel; + int projectID; + int languageID; + String stamp; + String ipAdress; + double versionID; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + + InsuranceAprovalsRequest( + { + this.exuldAppNO, + this.patientID, + this.channel = 9, + this.projectID = 12, + this.patientTypeID = 1, + this.languageID = 2, + this.stamp = '2020-04-23T21:01:21.492Z', + this.ipAdress = '11.11.11.11', + this.versionID = 1.2, + this.tokenID = '@dm!n', + this.sessionID = 'e29zoooEJ4', + this.isLoginForDoctorApp = true, + this.patientOutSA = false}); + + InsuranceAprovalsRequest.fromJson(Map json) { + exuldAppNO = json['EXuldAPPNO']; + patientID = json['PatientID']; + channel = json['Channel']; + projectID = json['ProjectID']; + patientTypeID = json['PatientTypeID']; + languageID = json['LanguageID']; + stamp = json['stamp']; + ipAdress = json['IPAdress']; + versionID = json['VersionID']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + } + + Map toJson() { + final Map data = new Map(); + data['EXuldAPPNO'] = this.exuldAppNO; + data['PatientID'] = this.patientID; + data['Channel'] = this.channel; + data['ProjectID'] = this.projectID; + data['PatientTypeID'] = this.patientTypeID; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.ipAdress; + data['VersionID'] = this.versionID; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + return data; + } +} diff --git a/lib/models/patient/orders_request.dart b/lib/models/patient/orders_request.dart new file mode 100644 index 00000000..92df2ab9 --- /dev/null +++ b/lib/models/patient/orders_request.dart @@ -0,0 +1,88 @@ + +/* + *@author: Ibrahim Albitar + *@Date:15/5/2020 + + *@param: +{"VisitType":3, +"AdmissionNo":2020004683, +"ProjectID":12, +"LanguageID":2, +"stamp":"2020-04-01T09:53:50.410Z", +"IPAdress":"11.11.11.11", +"VersionID":1.2, +"Channel":9, +"TokenID":"yIwh6wNyUkOeQlJRohWjyw==", +"SessionID":"LlBk8lUEJY", +"IsLoginForDoctorApp":true, +"PatientOutSA":false, +"PatientTypeID":1} + +*@return: + *@desc: + */ + +class OrdersRequest { + int visitType; + int admissionNo; + int projectID; + int languageID; + String stamp; + String iPAdress; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + double versionID; + + OrdersRequest( + {this.visitType , + this.admissionNo, + this.projectID = 12, + this.stamp = '2020-04-23T21:01:21.492Z', + this.languageID = 2, + this.iPAdress = '11.11.11.11', + this.channel = 9, + this.tokenID = '@dm!n', + this.sessionID = "LlBk8lUEJY", + this.isLoginForDoctorApp = true, + this.patientTypeID = 1, + this.versionID = 1.2, + this.patientOutSA = false}); + + OrdersRequest.fromJson(Map json) { + visitType = json['VisitType']; + admissionNo = json['AdmissionNo']; + projectID = json['ProjectID']; + stamp = json['stamp']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + versionID = json['VersionID']; + } + + Map toJson() { + final Map data = new Map(); + data['VisitType'] = this.visitType; + data['AdmissionNo'] = this.admissionNo; + data['ProjectID'] = this.projectID; + data['stamp'] = this.stamp; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + data['VersionID'] = this.versionID; + return data; + } +} \ No newline at end of file diff --git a/lib/models/patient/progress_note_request.dart b/lib/models/patient/progress_note_request.dart new file mode 100644 index 00000000..87e2bf66 --- /dev/null +++ b/lib/models/patient/progress_note_request.dart @@ -0,0 +1,88 @@ + +/* + *@author: Ibrahim Albitar + *@Date:15/5/2020 + + *@param: +{"VisitType":5, +"AdmissionNo":2020004683, +"ProjectID":12, +"LanguageID":2, +"stamp":"2020-04-01T09:41:59.089Z", +"IPAdress":"11.11.11.11", +"VersionID":1.2, +"Channel":9, +"TokenID":"yIwh6wNyUkOeQlJRohWjyw==", +"SessionID":"LlBk8lUEJY", +"IsLoginForDoctorApp":true, +"PatientOutSA":false, +"PatientTypeID":1} + +*@return: + *@desc: + */ + +class ProgressNoteRequest { + int visitType; + int admissionNo; + int projectID; + int languageID; + String stamp; + String iPAdress; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + int patientTypeID; + double versionID; + + ProgressNoteRequest( + {this.visitType , + this.admissionNo, + this.projectID = 12, + this.stamp = '2020-04-23T21:01:21.492Z', + this.languageID = 2, + this.iPAdress = '11.11.11.11', + this.channel = 9, + this.tokenID = '@dm!n', + this.sessionID = "LlBk8lUEJY", + this.isLoginForDoctorApp = true, + this.patientTypeID = 1, + this.versionID = 1.2, + this.patientOutSA = false}); + + ProgressNoteRequest.fromJson(Map json) { + visitType = json['VisitType']; + admissionNo = json['AdmissionNo']; + projectID = json['ProjectID']; + stamp = json['stamp']; + languageID = json['LanguageID']; + iPAdress = json['IPAdress']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + patientTypeID = json['PatientTypeID']; + versionID = json['VersionID']; + } + + Map toJson() { + final Map data = new Map(); + data['VisitType'] = this.visitType; + data['AdmissionNo'] = this.admissionNo; + data['ProjectID'] = this.projectID; + data['stamp'] = this.stamp; + data['LanguageID'] = this.languageID; + data['IPAdress'] = this.iPAdress; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + data['PatientTypeID'] = this.patientTypeID; + data['VersionID'] = this.versionID; + return data; + } +} \ No newline at end of file diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index c68e94d0..dbf68203 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -1,5 +1,10 @@ import 'dart:convert'; +import 'package:doctor_app_flutter/client/app_client.dart'; +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_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'; @@ -25,6 +30,8 @@ class PatientsProvider with ChangeNotifier { List patientLabResultOrdersList = []; List patientPrescriptionsList = []; List patientRadiologyList = []; + var patientProgressNoteList = []; + var insuranceApporvalsList = []; Client client = HttpClientWithInterceptor.build(interceptors: [HttpInterceptor()]); @@ -275,4 +282,72 @@ class PatientsProvider with ChangeNotifier { handelCatchErrorCase(err); } } + + + getPatientProgressNote(patient) async{ + setBasicData(); + try { + if (await Helpers.checkConnection()) { + final response =await AppClient.post(PATIENT_PROGRESS_NOTE_URL, body: json.encode(patient)); + final int statusCode = response.statusCode; + isLoading = false; + + if (statusCode < 200 || statusCode >= 400 || json == null) { + isError = true; + error = 'Error While Fetching data'; + } else { + var res = json.decode(response.body); + print('$res'); + if (res['MessageStatus'] == 1) { + patientProgressNoteList = res['List_GetPregressNoteForInPatient']; + } else { + isError = true; + error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; + } + } + } else { + isLoading = false; + isError = true; + error = 'Please Check The Internet Connection'; + } + notifyListeners(); + } catch (err) { + handelCatchErrorCase(err); + } + } + + getPatientInsuranceApprovals(patient) async{ + + //setBasicData(); + try { + if (await Helpers.checkConnection()) { + final response =await AppClient.post(PATIENT_INSURANCE_APPROVALS_URL, body: json.encode(patient)); + final int statusCode = response.statusCode; + isLoading = false; + + if (statusCode < 200 || statusCode >= 400 || json == null) { + isError = true; + error = 'Error While Fetching data'; + } else { + var res = json.decode(response.body); + print('$res'); + if (res['MessageStatus'] == 1) { + //patientRadiologyList = []; + insuranceApporvalsList = res['List_ApprovalMain_InPatient']; + } else { + isError = true; + error = res['ErrorMessage'] ?? res['ErrorEndUserMessage']; + } + } + } else { + isLoading = false; + isError = true; + error = 'Please Check The Internet Connection'; + } + notifyListeners(); + } catch (err) { + handelCatchErrorCase(err); + } + } + } diff --git a/lib/routes.dart b/lib/routes.dart index cb194c5b..048f9ecd 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -1,4 +1,11 @@ +<<<<<<< HEAD +======= +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/insurance_approvals_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/patient_orders_screen.dart'; +import 'package:doctor_app_flutter/screens/patients/profile/progress_note_screen.dart'; +>>>>>>> 7f5831335b1fac9625ba368a5bca916aaa9b9d74 import './screens/patients/profile/vital_sign/body_measurements_screen.dart'; @@ -51,6 +58,9 @@ const String VITAL_SIGN = 'patients/vital-sign'; const String LAB_ORDERS = 'patients/lab_orders'; const String PRESCRIPTIONS = 'patients/prescription'; const String RADIOLOGY = 'patients/radiology'; +const String PROGRESS_NOTE = 'patients/progress-note'; +const String PATIENT_ORDERS = 'patients/patient_orders'; +const String PATIENT_INSURANCE_APPROVALS = 'patients/patient_insurance_approvals'; const String VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; const String BODY_MEASUREMENTS = 'patients/body-measurements'; @@ -80,6 +90,9 @@ var routes = { LAB_ORDERS: (_) => LabOrdersScreen(), PRESCRIPTIONS: (_) => PrescriptionScreen(), RADIOLOGY: (_) => RadiologyScreen(), + PROGRESS_NOTE: (_) => ProgressNoteScreen(), + PATIENT_ORDERS: (_) => PatientsOrdersScreen(), + PATIENT_INSURANCE_APPROVALS: (_) => InsuranceApprovalsScreen(), VITAL_SIGN_DETAILS: (_) => VitalSignDetailsScreen(), BODY_MEASUREMENTS: (_) => BodyMeasurementsScreen() }; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 97e5158f..2146e547 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -252,9 +252,9 @@ class _DashboardScreenState extends State { child: DashboardItemIconText( DoctorApp.home_icon, "", - "In Patient", + "Search Medicine", showBorder: false, - backgroundColor: Colors.blueGrey[900], + backgroundColor: Colors.teal, ), onTap: () { Navigator.push( diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 2eab35c1..8b6467b1 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -187,6 +187,7 @@ class _PatientSearchScreenState extends State { onChanged: (String newValue) => { setState(() { _selectedType = newValue; + selectedPatientType = int.parse(_selectedType); }) }, items: PATIENT_TYPE.map((item) { diff --git a/lib/screens/patients/profile/insurance_approvals_screen.dart b/lib/screens/patients/profile/insurance_approvals_screen.dart new file mode 100644 index 00000000..d3083f7a --- /dev/null +++ b/lib/screens/patients/profile/insurance_approvals_screen.dart @@ -0,0 +1,151 @@ +import 'package:doctor_app_flutter/models/patient/insurance_aprovals_request.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: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/dr_app_circular_progress_Indeicator.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +/* + *@author: ibrahim albitar + *@Date:21/5/2020 + *@param: + *@return: + *@desc: + */ + +class InsuranceApprovalsScreen extends StatefulWidget { + @override + _InsuranceApprovalsState createState() => _InsuranceApprovalsState(); +} + +class _InsuranceApprovalsState extends State { + PatientsProvider patientsProv; + var _isInit = true; + + /* + *@author: ibrahim al bitar + *@Date:21/5/2020 + *@param: + *@return: + *@desc: + */ + getInsuranceApprovalsList(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); + + print(type); + InsuranceAprovalsRequest insuranceApprovalsRequest = InsuranceAprovalsRequest( + patientID: patient.patientId, + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2); + patientsProv.getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProv = Provider.of(context); + getInsuranceApprovalsList(context); + } + _isInit = false; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Insurance Approvals", + showAppDrawer: false, + showBottomBar: false, + body: patientsProv.isLoading + ? DrAppCircularProgressIndeicator() + : patientsProv.isError + ? DrAppEmbeddedError(error: patientsProv.error) + : patientsProv.insuranceApporvalsList.length == 0 + ? DrAppEmbeddedError( + error: 'You don\'t have any Insurance Approvals') + : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: + patientsProv.insuranceApporvalsList.length, + itemBuilder: (BuildContext ctxt, int index) { + return RoundedContainer( + backgroundColor: Colors.yellow[200], + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patientsProv + .insuranceApporvalsList[index] + ["ClinicName"]+"-"+patientsProv + .insuranceApporvalsList[index] + ["DoctorName"], + marginTop: 10, + marginLeft: 10, + marginBottom: 5, + fontWeight: FontWeight.bold, + ), + AppText( + convertDateFormat(patientsProv + .insuranceApporvalsList[index] + ["ApprovalDate"]), + marginLeft: 10, + color: Colors.grey[600], + ), + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + AppText( + patientsProv + .insuranceApporvalsList[index] + ["CompanyName"], + margin: 10, + ) + ], + )); + }), + ), + ); + } + + convertDateFormat(String str) { + 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(); + } +} diff --git a/lib/screens/patients/profile/patient_orders_screen.dart b/lib/screens/patients/profile/patient_orders_screen.dart new file mode 100644 index 00000000..d05a7504 --- /dev/null +++ b/lib/screens/patients/profile/patient_orders_screen.dart @@ -0,0 +1,150 @@ +import 'package:doctor_app_flutter/models/patient/progress_note_request.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: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/dr_app_circular_progress_Indeicator.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +/* + *@author: ibrahim albitar + *@Date:21/5/2020 + *@param: + *@return: + *@desc: + */ + +class PatientsOrdersScreen extends StatefulWidget { + @override + _PatientsOrdersState createState() => _PatientsOrdersState(); +} + +class _PatientsOrdersState extends State { + PatientsProvider patientsProv; + var _isInit = true; + + /* + *@author: ibrahim al bitar + *@Date:21/5/2020 + *@param: + *@return: + *@desc: + */ + getProgressNoteList(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); + + print(type); + ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( + visitType: 3, // if equal 3 then this will return orders + admissionNo: int.parse(patient.admissionNo), + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2); + patientsProv.getPatientProgressNote(progressNoteRequest.toJson()); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProv = Provider.of(context); + getProgressNoteList(context); + } + _isInit = false; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Orders", + showAppDrawer: false, + showBottomBar: false, + body: patientsProv.isLoading + ? DrAppCircularProgressIndeicator() + : patientsProv.isError + ? DrAppEmbeddedError(error: patientsProv.error) + : patientsProv.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: 'You don\'t have any Orders') + : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: + patientsProv.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return RoundedContainer( + + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patientsProv + .patientProgressNoteList[index] + ["DoctorName"], + marginTop: 10, + marginLeft: 10, + marginBottom: 5, + fontWeight: FontWeight.bold, + ), + AppText( + convertDateFormat(patientsProv + .patientProgressNoteList[index] + ["AssessmentDate"]), + marginLeft: 10, + color: Colors.grey[600], + ), + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + AppText( + patientsProv + .patientProgressNoteList[index] + ["Notes"], + margin: 10, + ) + ], + )); + }), + ), + ); + } + + convertDateFormat(String str) { + 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(); + } +} diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart new file mode 100644 index 00000000..7381e85b --- /dev/null +++ b/lib/screens/patients/profile/progress_note_screen.dart @@ -0,0 +1,150 @@ +import 'package:doctor_app_flutter/models/patient/progress_note_request.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: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/dr_app_circular_progress_Indeicator.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +/* + *@author: ibrahim albitar + *@Date:15/5/2020 + *@param: + *@return: + *@desc: + */ + +class ProgressNoteScreen extends StatefulWidget { + @override + _ProgressNoteState createState() => _ProgressNoteState(); +} + +class _ProgressNoteState extends State { + PatientsProvider patientsProv; + var _isInit = true; + + /* + *@author: ibrahim al bitar + *@Date:16/5/2020 + *@param: + *@return: + *@desc: + */ + getProgressNoteList(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); + + print(type); + ProgressNoteRequest progressNoteRequest = ProgressNoteRequest( + visitType: 5, // if equal 5 then this will return progress note + admissionNo: int.parse(patient.admissionNo), + projectID: patient.projectId, + tokenID: token, + patientTypeID: patient.patientType, + languageID: 2); + patientsProv.getPatientProgressNote(progressNoteRequest.toJson()); + } + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProv = Provider.of(context); + getProgressNoteList(context); + } + _isInit = false; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Progress Note", + showAppDrawer: false, + showBottomBar: false, + body: patientsProv.isLoading + ? DrAppCircularProgressIndeicator() + : patientsProv.isError + ? DrAppEmbeddedError(error: patientsProv.error) + : patientsProv.patientProgressNoteList.length == 0 + ? DrAppEmbeddedError( + error: 'You don\'t have any Progress Note') + : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: ListView.builder( + itemCount: + patientsProv.patientProgressNoteList.length, + itemBuilder: (BuildContext ctxt, int index) { + return RoundedContainer( + backgroundColor: Colors.yellow[200], + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + patientsProv + .patientProgressNoteList[index] + ["DoctorName"], + marginTop: 10, + marginLeft: 10, + marginBottom: 5, + fontWeight: FontWeight.bold, + ), + AppText( + convertDateFormat(patientsProv + .patientProgressNoteList[index] + ["AssessmentDate"]), + marginLeft: 10, + color: Colors.grey[600], + ), + Divider( + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), + AppText( + patientsProv + .patientProgressNoteList[index] + ["Notes"], + margin: 10, + ) + ], + )); + }), + ), + ); + } + + convertDateFormat(String str) { + 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(); + } +} diff --git a/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart b/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart index bf89edac..992a5780 100644 --- a/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart +++ b/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart @@ -36,7 +36,7 @@ class BodyMeasurementsScreen extends StatelessWidget { barGroupingType: charts.BarGroupingType.grouped, // behaviors: [new charts.SeriesLegend()], // primaryMeasureAxis: , - animationDuration: Duration(seconds: 5), + animationDuration: Duration(seconds: 1), ), ), ], diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 2065ea57..de75f0ec 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -16,6 +16,7 @@ DrAppToastMsg toastMsg = DrAppToastMsg(); *@desc: This class will contian some Function will help developer */ class Helpers { + int cupertinoPickerIndex = 0; /* *@author: Elham Rababah *@Date:12/4/2020 @@ -25,14 +26,58 @@ class Helpers { */ showCupertinoPicker(context, items, decKey, onSelectFun) { showModalBottomSheet( + isDismissible: false, context: context, builder: (BuildContext builder) { return Container( - height: SizeConfig.realScreenHeight * .3, - child: buildPickerItems(context, items, decKey, onSelectFun)); + // height: 500, + height: SizeConfig.realScreenHeight * 0.4, + color: Color(0xfff7f7f7), + child: Column( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + color: Color(0xfff7f7f7), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + CupertinoButton( + child: Text('Cancel'.toUpperCase(), style: textStyle(context)), + onPressed: () { + Navigator.pop(context); + }, + // padding: const EdgeInsets.symmetric( + // horizontal: 16.0, + // vertical: 5.0, + // ), + ), + CupertinoButton( + child: Text( + 'Done'.toUpperCase(), + style: textStyle(context), + ), + onPressed: () { + Navigator.pop(context); + onSelectFun(cupertinoPickerIndex); + }, + ) + ], + ), + ), + Container( + height: SizeConfig.realScreenHeight * 0.3, + color: Color(0xfff7f7f7), + child: + buildPickerItems(context, items, decKey, onSelectFun)) + ], + ), + ); }); } + TextStyle textStyle(context) => + TextStyle(color: Theme.of(context).primaryColor); + /* *@author: Elham Rababah *@Date:12/4/2020 @@ -41,24 +86,24 @@ class Helpers { *@desc: buildPickerIterm this function will build the items of the cupertino */ buildPickerItems(context, List items, decKey, onSelectFun) { - return Container( - child: CupertinoPicker( - magnification: 1.5, - // backgroundColor: Colors.black87, - children: items.map((item) { - return Text( - '${item["$decKey"]}', - style: TextStyle(fontSize: SizeConfig.textMultiplier *3), - ); - }).toList(), + return CupertinoPicker( + magnification: 1.5, + scrollController: FixedExtentScrollController(initialItem: cupertinoPickerIndex), - itemExtent: 25, //height of each item - looping: true, - onSelectedItemChanged: (int index) { - // selectitem =index; - onSelectFun(index); - }, - ), + // backgroundColor: Colors.black87, + children: items.map((item) { + return Text( + '${item["$decKey"]}', + style: TextStyle(fontSize: SizeConfig.textMultiplier * 3), + ); + }).toList(), + + itemExtent: 25, //height of each item + looping: true, + onSelectedItemChanged: (int index) { + // selectitem =index; + cupertinoPickerIndex = index; + }, ); } @@ -96,6 +141,7 @@ class Helpers { return false; } } + /* *@author: Elham Rababah *@Date:12/5/2020 @@ -103,15 +149,11 @@ class Helpers { *@return: String *@desc: generate Contact Admin Msg */ -generateContactAdminMsg([err = null]) { - String localMsg = 'Something wrong happened, please contact the admin'; + generateContactAdminMsg([err = null]) { + String localMsg = 'Something wrong happened, please contact the admin'; if (err != null) { - localMsg = localMsg +'\n \n'+ err.toString(); + localMsg = localMsg + '\n \n' + err.toString(); } return localMsg; - -} - + } } - - diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 43daa219..8ce783d0 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -53,6 +53,9 @@ class _LoginFormState extends State { @override Widget build(BuildContext context) { + final focusPass = FocusNode(); + final focusProject = FocusNode(); + if (projectsList.length == 0) { getProjectsList(); } @@ -68,6 +71,7 @@ class _LoginFormState extends State { buildSizedBox(), TextFormField( keyboardType: TextInputType.number, + textInputAction: TextInputAction.next, decoration: buildInputDecoration( context, 'Enter ID', 'assets/images/user_id_icon.png'), validator: (value) { @@ -79,23 +83,35 @@ class _LoginFormState extends State { onSaved: (value) { userInfo.UserID = value; }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusPass); + }, ), buildSizedBox(), TextFormField( - obscureText: true, - decoration: buildInputDecoration(context, 'Enter Password', - 'assets/images/password_icon.png'), - validator: (value) { - if (value.isEmpty) { - return 'Please enter your Password'; - } - return null; - }, - onSaved: (value) { - userInfo.Password = value; - }), + focusNode: focusPass, + obscureText: true, + textInputAction: TextInputAction.next, + decoration: buildInputDecoration( + context, 'Enter Password', 'assets/images/password_icon.png'), + validator: (value) { + if (value.isEmpty) { + return 'Please enter your Password'; + } + return null; + }, + onSaved: (value) { + userInfo.Password = value; + }, + onFieldSubmitted: (_) { + FocusScope.of(context).requestFocus(focusProject); + helpers.showCupertinoPicker( + context, projectsList, 'Name', onSelectProject); + }, + ), buildSizedBox(), TextFormField( + focusNode: focusProject, controller: projectIdController, onTap: () { helpers.showCupertinoPicker( @@ -312,7 +328,7 @@ class _LoginFormState extends State { onSelectProject(index) { setState(() { userInfo.ProjectID = projectsList[index]["ID"]; - projectIdController.text = projectsList[index]['Desciption']; + projectIdController.text = projectsList[index]['Name']; }); } } diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index f701d554..465ce07e 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -51,7 +51,10 @@ class _VerifyAccountState extends State { @override Widget build(BuildContext context) { authProv = Provider.of(context); - + final focusD1 = FocusNode(); + final focusD2 = FocusNode(); + final focusD3 = FocusNode(); + final focusD4 = FocusNode(); return FutureBuilder( future: Future.wait([_loggedUserFuture]), builder: (BuildContext context, AsyncSnapshot snapshot) { @@ -78,6 +81,7 @@ class _VerifyAccountState extends State { Container( width: SizeConfig.realScreenWidth * 0.20, child: TextFormField( + textInputAction: TextInputAction.next, style: buildTextStyle(), maxLength: 1, textAlign: TextAlign.center, @@ -89,24 +93,37 @@ class _VerifyAccountState extends State { val; }, validator: validateCodeDigit, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD2); + }, )), Container( - width: SizeConfig.realScreenWidth * 0.20, - child: TextFormField( - maxLength: 1, - textAlign: TextAlign.center, - style: buildTextStyle(), - keyboardType: TextInputType.number, - decoration: - buildInputDecoration(context), - onSaved: (val) { - verifyAccountFormValue['digit2'] = - val; - }, - validator: validateCodeDigit)), + width: SizeConfig.realScreenWidth * 0.20, + child: TextFormField( + focusNode: focusD2, + textInputAction: TextInputAction.next, + maxLength: 1, + textAlign: TextAlign.center, + style: buildTextStyle(), + keyboardType: TextInputType.number, + decoration: + buildInputDecoration(context), + onSaved: (val) { + verifyAccountFormValue['digit2'] = + val; + }, + onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD3); + }, + validator: validateCodeDigit), + ), Container( width: SizeConfig.realScreenWidth * 0.20, child: TextFormField( + focusNode: focusD3, + textInputAction: TextInputAction.next, maxLength: 1, textAlign: TextAlign.center, style: buildTextStyle(), @@ -116,11 +133,15 @@ class _VerifyAccountState extends State { onSaved: (val) { verifyAccountFormValue['digit3'] = val; - }, + },onFieldSubmitted: (_) { + FocusScope.of(context) + .requestFocus(focusD4); + }, validator: validateCodeDigit)), Container( width: SizeConfig.realScreenWidth * 0.20, child: TextFormField( + focusNode: focusD4, maxLength: 1, textAlign: TextAlign.center, style: buildTextStyle(), @@ -294,18 +315,19 @@ class _VerifyAccountState extends State { if (res['MessageStatus'] == 1) { sharedPref.setString(TOKEN, res['AuthenticationTokenID']); if (res['List_DoctorProfile'] != null) { - loginProcessCompleted(res['List_DoctorProfile'][0],changeLoadingStata); + 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); + getDocProfiles(clinic, changeLoadingStata); }); } } else { - changeLoadingStata(false); + changeLoadingStata(false); helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { @@ -319,7 +341,6 @@ class _VerifyAccountState extends State { } } - /* *@author: Elham Rababah *@Date:17/5/2020 @@ -327,7 +348,8 @@ class _VerifyAccountState extends State { *@return: *@desc: loginProcessCompleted */ - loginProcessCompleted(Map profile, Function changeLoadingStata) { + loginProcessCompleted( + Map profile, Function changeLoadingStata) { changeLoadingStata(false); sharedPref.setObj(DOCTOR_PROFILE, profile); Navigator.of(context).pushNamed(HOME); @@ -375,7 +397,7 @@ class _VerifyAccountState extends State { print("DoctorProfileList ${res['DoctorProfileList'][0]}"); loginProcessCompleted(res['DoctorProfileList'][0], changeLoadingStata); } else { - changeLoadingStata(false); + changeLoadingStata(false); helpers.showErrorToast(res['ErrorEndUserMessage']); } }).catchError((err) { diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index 462f76ef..0eb11866 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -150,7 +150,7 @@ class _VerificationMethodsState extends State { top: SizeConfig.heightMultiplier * 0.5), child: Image.asset( url, - height: SizeConfig.heightMultiplier * 11, + height: SizeConfig.heightMultiplier * 10, fit: BoxFit.cover, ), ), @@ -182,11 +182,11 @@ class _VerificationMethodsState extends State { Map model = { "LogInTokenID": _loggedUser['LogInTokenID'], "Channel": 9, - "MobileNumber": 785228065, //_loggedUser['MobileNumber'], + "MobileNumber": _loggedUser['MobileNumber'], "IPAdress": "11.11.11.11", "LanguageID": 2, "ProjectID": 15, //TODO : this should become daynamci - "ZipCode": 962, //_loggedUser['ZipCode'], + "ZipCode": _loggedUser['ZipCode'], "UserName": _loggedUser['List_MemberInformation'][0]['MemberID'], "OTP_SendType": oTPSendType }; diff --git a/lib/widgets/patients/profile/profile_header_widget.dart b/lib/widgets/patients/profile/profile_header_widget.dart index 4aa9f92b..1a5aec8a 100644 --- a/lib/widgets/patients/profile/profile_header_widget.dart +++ b/lib/widgets/patients/profile/profile_header_widget.dart @@ -28,7 +28,7 @@ class ProfileHeaderWidget extends StatelessWidget { height: SizeConfig.heightMultiplier * 30, child: ProfileImageWidget( url: - "http://images4.fanpop.com/image/photos/16200000/David-Schwimmer-Ross-Geller-ross-geller-16258927-629-779.jpg", + "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", name: patient.firstName + ' ' + patient.lastName, des: patient.patientId.toString(), height: SizeConfig.heightMultiplier * 17, diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 5bf83cf0..3f40204b 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/routes.dart'; @@ -51,8 +52,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { child: CircleAvatarWidget( des: 'Vital Sign', url: url + 'heartbeat.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, ), ), InkWell( @@ -62,8 +63,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { child: CircleAvatarWidget( des: 'Lab Result', url: url + 'lab.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, ), ), InkWell( @@ -73,8 +74,8 @@ class ProfileMedicalInfoWidget extends StatelessWidget { child: CircleAvatarWidget( des: 'Prescription', url: url + 'note.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, ), ), InkWell( @@ -85,8 +86,69 @@ class ProfileMedicalInfoWidget extends StatelessWidget { child: CircleAvatarWidget( des: 'Radiology', url: url + 'radiology-1.png', - width: (contWidth) / 3.5, - height: (contWidth) / 3.5, + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), + ), + ], + ), + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Visibility( + visible: selectedPatientType != 0 && selectedPatientType != 5 , + child: InkWell( + onTap: () { + navigator(context, PROGRESS_NOTE); + }, + child: CircleAvatarWidget( + des: 'Progress Notes', + url: url + 'heartbeat.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), + ), + ), + Visibility( + + child: InkWell( + onTap: () { + navigator(context, PATIENT_INSURANCE_APPROVALS); + }, + child: CircleAvatarWidget( + des: 'Insurance Aprovals', + url: url + 'lab.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), + ), + ), + Visibility( + visible: selectedPatientType != 0 && selectedPatientType != 5 && selectedPatientType != 2, + child: InkWell( + onTap: () { + navigator(context, PRESCRIPTIONS); + }, + child: CircleAvatarWidget( + des: 'Refer Patient ', + url: url + 'note.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), + ), + ), + Visibility( + visible: selectedPatientType != 0 && selectedPatientType != 5, + child: InkWell( + onTap: () { + navigator(context, PATIENT_ORDERS); + }, + child: CircleAvatarWidget( + des: 'Orders', + url: url + 'radiology-1.png', + width: (contWidth) / 4.5, + height: (contWidth) / 4.5, + ), ), ), ], @@ -146,7 +208,7 @@ class CircleAvatarWidget extends StatelessWidget { ), AppText( des, - fontSize: 2 * SizeConfig.textMultiplier, + fontSize: 1.5 * SizeConfig.textMultiplier, textAlign: TextAlign.center, ) ], diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 430387bc..e124a88f 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -1,13 +1,18 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../config/shared_pref_kay.dart'; import '../../config/size_config.dart'; import '../../providers/schedule_provider.dart'; import '../../routes.dart'; import '../../screens/doctor/my_schedule_screen.dart'; +import '../../util/dr_app_shared_pref.dart'; import '../../widgets/shared/drawer_item_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart'; import 'app_texts_widget.dart'; +import 'package:doctor_app_flutter/models/doctor_profile_model.dart'; + +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); // OWNER : Ibrahim albitar // DATE : 06-04-2020 @@ -19,8 +24,30 @@ class AppDrawer extends StatefulWidget { } class _AppDrawerState extends State { + bool _isInit = true; + DoctorProfileModel doctorProfile; + @override + void didChangeDependencies() { + super.didChangeDependencies(); + // if (_isInit) { + getDocProfile();// TODO: Refactor this code to prevent errors in the cosole. + // } + _isInit = false; + } + + getDocProfile() async { + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); + // doctorProfile = DoctorProfileModel.fromJson(profile); + setState(() { + doctorProfile = DoctorProfileModel.fromJson(profile); + }); + + String token = await sharedPref.getString(TOKEN); + } + @override Widget build(BuildContext context) { + // var x = getDocProfile(); return RoundedContainer( child: Container( margin: EdgeInsets.only(top: SizeConfig.heightMultiplier * 9), @@ -35,19 +62,20 @@ class _AppDrawerState extends State { children: [ CircleAvatar( radius: SizeConfig.imageSizeMultiplier * 12, - backgroundImage: NetworkImage( - "https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png"), + backgroundImage: + NetworkImage(doctorProfile.doctorImageURL), backgroundColor: Colors.transparent, ), Padding( padding: EdgeInsets.only(top: 10), child: AppText( - "Dr. Chris evans", + doctorProfile.doctorName, + fontWeight: FontWeight.bold, color: Colors.white, - fontSize: SizeConfig.textMultiplier * 3, + fontSize: SizeConfig.textMultiplier * 2, )), - AppText("Director of medical records", + AppText("Director of medical records",//TODO: Make The Dr Title Dynamic and check overflow issue. fontWeight: FontWeight.normal, color: Colors.white) ], ), @@ -83,6 +111,12 @@ class _AppDrawerState extends State { Navigator.of(context).pushNamed(QR_READER); }, ), + InkWell( + child: DrawerItem("lOGOUT", Icons.exit_to_app), + onTap: () { + Navigator.of(context).pushNamed(LOGIN); + }, + ), ])), ), width: SizeConfig.realScreenWidth * 0.55, diff --git a/lib/widgets/shared/app_scaffold_widget.dart b/lib/widgets/shared/app_scaffold_widget.dart index 2d64ece5..e7b9012e 100644 --- a/lib/widgets/shared/app_scaffold_widget.dart +++ b/lib/widgets/shared/app_scaffold_widget.dart @@ -71,7 +71,7 @@ class AppScaffold extends StatelessWidget { height: 50, width: 50, url: - "https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", + "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown_female.png", ) ], ),