From 3c03647392bbb5186d65448ea23df9b931459151 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 4 May 2020 09:19:40 +0300 Subject: [PATCH 1/8] out of stuk --- lib/screens/medicine/pharmacies_list_screen.dart | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index c68da864..0b7afab7 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -27,6 +27,7 @@ class _PharmaciesListState extends State { var _data; Helpers helpers = new Helpers(); MedicineProvider _medicineProvider; + //bool _isOutOfStuck = false; @override Widget build(BuildContext context) { @@ -121,6 +122,7 @@ class _PharmaciesListState extends State { _medicineProvider.getPharmaciesList(widget.itemID).then((result) { this.setState(() { _data = _medicineProvider.pharmaciesList; + //if(_data == null || _data.length == 0) }); }); return true; From 80b6716091d2f924c11c217c608ae04e9ffb3ded Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 May 2020 01:20:08 +0300 Subject: [PATCH 2/8] call phramicies --- lib/config/config.dart | 6 ++- .../medicine/pharmacies_list_screen.dart | 54 ++++++++++++++----- .../medicine/medicine_item_widget.dart | 3 +- lib/widgets/shared/app_buttons_widget.dart | 10 ++-- pubspec.yaml | 3 ++ 5 files changed, 57 insertions(+), 19 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index 3c3a1491..93dfa881 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -3,7 +3,7 @@ const ONLY_NUMBERS = "[0-9]"; const ONLY_LETTERS = "[a-zA-Z]"; const ONLY_DATE = "[0-9/]"; -const BASE_URL = 'https://hmgwebservices.com/Services/'; +const BASE_URL = 'https://uat.hmgwebservices.com/Services/'; const PHARMACY_ITEMS_URL = "Lists.svc/REST/GetPharmcyItems"; const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; //*********change value to decode json from Dropdown ************ @@ -11,3 +11,7 @@ const PHARMACY_LIST_URL = "Patients.svc/REST/GetPharmcyList"; 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 diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 0b7afab7..c34d26e4 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -1,15 +1,20 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/models/pharmacies_List_request_model.dart'; import 'package:doctor_app_flutter/providers/medicine_provider.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:maps_launcher/maps_launcher.dart'; +import 'package:url_launcher/url_launcher.dart'; + DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); @@ -95,20 +100,43 @@ class _PharmaciesListState extends State { shrinkWrap: true, itemCount: _data == null ? 0 : _data.length, itemBuilder: (BuildContext context, int index) { - return InkWell( - child: MedicineItemWidget( - label: _data[index]["LocationDescription"], - ), - onTap: () { - //Navigator.of(context).pushNamed(PHARMACIES_LIST); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PharmaciesListScreen( - itemID: _data[index]["ItemID"]), + return Column( + children: [ + MedicineItemWidget( + label: _data[index]["LocationDescription"], + ), + Container( + margin: EdgeInsets.only(bottom: 10), + child: Row( + children: [ + Expanded(flex: 2, child: SizedBox()), + Expanded( + flex: 6, + child: AppButton( + title: "Call", + fontSize: 2, + color: Colors.brown[200], + padding: 0, + onPressed: () => launch("tel://"+_data[index]["PhoneNumber"])), + ), + Expanded(flex: 1, child: SizedBox()), + Expanded( + flex: 6, + child: AppButton( + title: "Direction", + fontSize: 2, + color: Color(PRIMARY_COLOR), + padding: 0, + onPressed: () { + MapsLauncher.launchCoordinates(double.parse(_data[index]["Latitude"]), double.parse( _data[index]["Longitude"]), _data[index]["LocationDescription"] ); + }), + + ), + Expanded(flex: 2, child: SizedBox()), + ], ), - ); - }, + ) + ], ); }, ), diff --git a/lib/widgets/medicine/medicine_item_widget.dart b/lib/widgets/medicine/medicine_item_widget.dart index 56cf4638..e18477c4 100644 --- a/lib/widgets/medicine/medicine_item_widget.dart +++ b/lib/widgets/medicine/medicine_item_widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; import '../shared/rounded_container_widget.dart'; @@ -35,7 +36,7 @@ class _MedicineItemWidgetState extends State { children: [ RoundedContainer( width: SizeConfig.widthMultiplier * 2, - backgroundColor: Colors.red, + backgroundColor: Color(PRIMARY_COLOR), margin: 0, topLeft: 6, topRight: 0, diff --git a/lib/widgets/shared/app_buttons_widget.dart b/lib/widgets/shared/app_buttons_widget.dart index 49c0c92e..10bf6997 100644 --- a/lib/widgets/shared/app_buttons_widget.dart +++ b/lib/widgets/shared/app_buttons_widget.dart @@ -11,8 +11,10 @@ class AppButton extends StatefulWidget { final String title; final IconData icon; final Color color; + final double fontSize; + final double padding; - AppButton({@required this.onPressed, this.title, this.icon, this.color}); + AppButton({@required this.onPressed, this.title, this.icon, this.color, this.fontSize = 2.5, this.padding = 15}); _AppButtonState createState() => _AppButtonState(); @@ -29,8 +31,8 @@ class AppButton extends StatefulWidget { padding: EdgeInsets.only( top: 10, bottom: 10, - right: SizeConfig.widthMultiplier * 15, - left: SizeConfig.widthMultiplier* 15 + right: SizeConfig.widthMultiplier * widget.padding, + left: SizeConfig.widthMultiplier * widget.padding ), child: Row( mainAxisSize: MainAxisSize.min, @@ -45,7 +47,7 @@ class AppButton extends StatefulWidget { AppText( widget.title, color: Colors.white, - fontSize: SizeConfig.textMultiplier * 2.5, + fontSize: SizeConfig.textMultiplier * widget.fontSize , fontWeight: FontWeight.bold, ), ], diff --git a/pubspec.yaml b/pubspec.yaml index 20f3f50a..8a82ea4a 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -32,6 +32,9 @@ dependencies: http_interceptor: ^0.2.0 progress_hud_v2: ^2.0.0 connectivity: ^0.4.8+2 + maps_launcher: ^1.2.0 + url_launcher: ^5.4.5 + # The following adds the Cupertino Icons font to your application. From c09c1599fcad0aed09b1fdba25838a7aecf17855 Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Wed, 6 May 2020 10:51:05 +0300 Subject: [PATCH 3/8] Filter search in outPatiant and format time --- lib/models/patient/patiant_info_model.dart | 6 +- lib/providers/patients_provider.dart | 4 +- .../patients/patient_search_screen.dart | 8 +- lib/screens/patients/patients_screen.dart | 363 +++++++++++++----- 4 files changed, 277 insertions(+), 104 deletions(-) diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index 94a5c09d..c85edace 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -50,9 +50,10 @@ class PatiantInformtion { String age; String genderDescription; String nursingStationName; + String appointmentDate; PatiantInformtion({ - this.list, + this.list, this.projectId, this.clinicId, this.doctorId, @@ -85,6 +86,8 @@ class PatiantInformtion { this.age, this.genderDescription, this.nursingStationName, + this.appointmentDate, + }); factory PatiantInformtion.fromJson(Map json) => PatiantInformtion( @@ -120,6 +123,7 @@ class PatiantInformtion { age: json["Age"], genderDescription: json["GenderDescription"], nursingStationName: json["NursingStationName"], + appointmentDate: json["AppointmentDate"], ); diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index f207ee15..bf22e565 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -44,8 +44,8 @@ class PatientsProvider with ChangeNotifier { // 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]; + final url ="https://uat.hmgwebservices.com/Services/DoctorApplication.svc/REST/"+ SERVICES_PATIANT[val];///"https://uat.hmgwebservices.com/Services/Doctors.svc/REST/"; + //BASE_URL + 'DoctorApplication.svc/REST/' + SERVICES_PATIANT[val]; // print("a===========$url=======a"); try { diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 97987ff0..2582310a 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -37,8 +37,8 @@ class _PatientSearchScreenState extends State { var _patientSearchFormValues = PatientModel( ProjectID: 15, - ClinicID: 14, - DoctorID: 243763, + ClinicID: 0, + DoctorID: 4709, FirstName: "0", MiddleName: "0", LastName: "0", @@ -64,13 +64,13 @@ class _PatientSearchScreenState extends State { 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(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 = projectID; + _patientSearchFormValues.ProjectID = 15;//projectID; // print(_patientSearchFormValues.PatientMobileNumber+"dfdfdfddf"); Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 91c15022..fc2eb3d6 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -6,6 +6,7 @@ *@desc: */ + import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; @@ -13,7 +14,9 @@ import 'package:doctor_app_flutter/providers/patients_provider.dart'; 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:flutter/material.dart'; +import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; //************* @@ -33,7 +36,7 @@ class PatientsScreen extends StatefulWidget { class _PatientsScreenState extends State { List litems; - // final List parsed; + // final List parsed; List parsed; //********** List date; @@ -42,10 +45,7 @@ class _PatientsScreenState extends State { List responseModelList; List responseModelList2; - - - - + // List _locations = ['Today', 'Old Date', 'YESTERDAY']; List _locations = ['Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; @@ -59,6 +59,7 @@ class _PatientsScreenState extends State { final _controller = TextEditingController(); //************** PatientModel patient; + PatientsProvider patientsProv; @override void didChangeDependencies() { @@ -71,7 +72,6 @@ class _PatientsScreenState extends State { patientType = routeArgs['selectedType']; patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; - print(patientType); if (_isInit) { @@ -82,137 +82,301 @@ class _PatientsScreenState extends State { int val2 = int.parse(patientType); litems = res[SERVICES_PATIANT2[val2]]; - parsed = litems; + parsed = litems; responseModelList = new ModelResponse.fromJson(parsed).list; - responseModelList2=responseModelList; + responseModelList2 = responseModelList; //******************** _isLoading = false; + _hasError = res['ErrorEndUserMessage']; }); print(res); }).catchError((error) { + // patientsProv.isLoading=false; + // patientsProv.isError=true; + print("====================error================"); print(error); }); } + _isInit = false; + super.didChangeDependencies(); } + /* *@author: Amjad Amireh *@Date:2/5/2020 *@param: - *@return:PatientsScreen Search textbox + *@return:PatientsScreen Search textbox filter *@desc: */ - searchData(String str) { + + searchData(String str) { + this.responseModelList = this.responseModelList2; var strExist = str.length > 0 ? true : false; if (strExist) { - List filterData=[] ; + List filterData = []; + for (var i = 0; i < responseModelList2.length; i++) { - String firstName = responseModelList[i].firstName.toUpperCase(); String lastName = responseModelList[i].lastName.toUpperCase(); - if (firstName.contains(str.toUpperCase())||lastName.contains(str.toUpperCase())) { - print("==========data done==========="); + if (firstName.contains(str.toUpperCase()) || + lastName.contains(str.toUpperCase())) { filterData.add(responseModelList[i]); } } + setState(() { - print("==========data good==========="); this.responseModelList = filterData; }); } else { setState(() { - print("==========no data==========="); - - this.responseModelList =this.responseModelList2; + this.responseModelList = this.responseModelList2; + }); + } + } + +//***********DateFormat************** +/* + *@author: Amjad Amireh + *@Date:5/5/2020 + *@param: + *@return:Convert time from Milesecond to date with time + + *@desc: + */ + convertDate(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 newDateformat = date.year.toString() + + "/" + + date.month.toString().padLeft(2, '0') + + "/" + + date.day.toString().padLeft(2, '0') + + " " + + "-" + + " " + + date.hour.toString().padLeft(2, '0') + + ":" + + date.minute.toString().toString().padLeft(2, '0'); + + return newDateformat.toString(); + } + +/* + *@author: Amjad Amireh + *@Date:5/5/2020 + *@param: + *@return:Convert time from Milesecond to date + + *@desc: + */ + convertDateFormat(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; + + var strExist = str.length > 0 ? true : false; + if (true) { + List filterDate = []; + + for (var i = 0; i < responseModelList2.length; i++) { + String patiantAppointment = + convertDateFormat(responseModelList[i].appointmentDate); + + String dateAppointment = checkDate(patiantAppointment); + + if (dateAppointment.contains(str)) { + filterDate.add(responseModelList[i]); + } + } + + setState(() { + this.responseModelList = filterDate; + }); + } else { + setState(() { + this.responseModelList = this.responseModelList2; }); } } + 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"; + } 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"; + } + if ((currentTime.day - checkedTime.day) <= -2) { + return "Next Week"; + } else { + return "Old Date"; + } + } + return "Old Date"; + } + +//************************* @override Widget build(BuildContext context) { PatientsProvider patientsProv = Provider.of(context); return AppScaffold( - appBarTitle: patientTypetitle, + appBarTitle: patientTypetitle, //***********Modify by amjad (create List view to insert all new data webservise in scroll )************* - body: Container( - // margin: EdgeInsets.all(20), - child: ListView(scrollDirection: Axis.vertical, children: [ - Container( - child: litems == null - ? Column() - : - Column( - children: [ - Padding( - padding: EdgeInsets.only( - top: MediaQuery.of(context).size.height * 0.03), - child: _locationBar(context), - ), - SizedBox(height: 10.0), - Container( - width: SizeConfig.screenWidth * 0.80, - child: TextField( - controller: _controller, - - onChanged: (String str){ - // print(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, - fontSize: 2.5 * SizeConfig.textMultiplier, - ), - SizedBox( - height: 8, - ), - AppText(item.lastName, - fontSize: - 2.5 * SizeConfig.textMultiplier), - SizedBox( - height: 8, - ), - AppText(item.middleName, - fontSize: - 2.5 * SizeConfig.textMultiplier), - ], + 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), + ), + ) + ], + ) + : 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(), ), - ), - onTap: () { - Navigator.of(context).pushNamed( - PATIENTS_PROFILE, - arguments: {"patient": item}); - }, - ); - }).toList(), - ), - ), - ], - )) - ]))); + 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}); + }, + ); + }).toList(), + ), + ), + ], + )) + ]))); } //***********amjad update**buildInputDecoration ***to search box******** @@ -243,22 +407,27 @@ class _PatientsScreenState extends State { mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisSize: MainAxisSize.max, crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((l) { - bool _isActive = _locations[_activeLocation] == l ? true : false; + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item ? true : false; return Column(mainAxisSize: MainAxisSize.min, children: [ InkWell( child: Text( - l, + item, style: TextStyle( fontSize: 15, color: Colors.white, fontWeight: FontWeight.bold), ), onTap: () { - print(l); - print(_locations.indexOf(l)); + + print(_locations.indexOf(item)); + + + filterBooking(item.toString()); + setState(() { - _activeLocation = _locations.indexOf(l); + _activeLocation = _locations.indexOf(item); + }); }), _isActive From 7c291f8d63fda16d71bfffac8527a4063f6f4df8 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 6 May 2020 14:17:54 +0300 Subject: [PATCH 4/8] add comment and fix some pugs --- lib/interceptor/http_interceptor.dart | 1 + lib/models/patient/lab_orders_req_model.dart | 8 ++++++++ lib/models/patient/lab_orders_res_model.dart | 7 +++++++ lib/models/patient/prescription_req_model.dart | 7 +++++++ lib/models/patient/prescription_res_model.dart | 7 +++++++ lib/models/patient/radiology_req_model.dart | 7 +++++++ lib/models/patient/radiology_res_model.dart | 7 +++++++ lib/models/patient/vital_sign_res_model.dart | 7 +++++++ lib/providers/patients_provider.dart | 2 +- lib/routes.dart | 8 ++++---- lib/screens/patients/patients_screen.dart | 1 - 11 files changed, 56 insertions(+), 6 deletions(-) diff --git a/lib/interceptor/http_interceptor.dart b/lib/interceptor/http_interceptor.dart index c27b3cb9..4d0f9c33 100644 --- a/lib/interceptor/http_interceptor.dart +++ b/lib/interceptor/http_interceptor.dart @@ -25,6 +25,7 @@ class HttpInterceptor extends InterceptorContract { Future interceptRequest({RequestData data}) async { print('RequestData ${data.body}'); + print('RequestData ${data.url}'); try { data.headers["Content-Type"] = "application/json"; data.headers["Accept"] = "application/json"; diff --git a/lib/models/patient/lab_orders_req_model.dart b/lib/models/patient/lab_orders_req_model.dart index dc0fb584..0295ce8d 100644 --- a/lib/models/patient/lab_orders_req_model.dart +++ b/lib/models/patient/lab_orders_req_model.dart @@ -1,3 +1,11 @@ + +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: + *@return:LabOrdersReqModel + *@desc: LabOrdersReqModel class + */ class LabOrdersReqModel { int patientID; int patientTypeID; diff --git a/lib/models/patient/lab_orders_res_model.dart b/lib/models/patient/lab_orders_res_model.dart index 41d41125..556f0474 100644 --- a/lib/models/patient/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders_res_model.dart @@ -1,3 +1,10 @@ +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: + *@return:LabOrdersResModel + *@desc: LabOrdersResModel class + */ class LabOrdersResModel { String setupID; int projectID; diff --git a/lib/models/patient/prescription_req_model.dart b/lib/models/patient/prescription_req_model.dart index a4bfe1b7..45ca2d74 100644 --- a/lib/models/patient/prescription_req_model.dart +++ b/lib/models/patient/prescription_req_model.dart @@ -1,3 +1,10 @@ +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: + *@return:PrescriptionReqModel + *@desc: PrescriptionReqModel class + */ class PrescriptionReqModel { int patientID; int setupID; diff --git a/lib/models/patient/prescription_res_model.dart b/lib/models/patient/prescription_res_model.dart index 5ff08e3e..7bb545ee 100644 --- a/lib/models/patient/prescription_res_model.dart +++ b/lib/models/patient/prescription_res_model.dart @@ -1,3 +1,10 @@ +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: + *@return:PrescriptionResModel + *@desc: PrescriptionResModel class + */ class PrescriptionResModel { String setupID; int projectID; diff --git a/lib/models/patient/radiology_req_model.dart b/lib/models/patient/radiology_req_model.dart index 35b398bf..b39fb393 100644 --- a/lib/models/patient/radiology_req_model.dart +++ b/lib/models/patient/radiology_req_model.dart @@ -1,3 +1,10 @@ +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: + *@return:RadiologyReqModel + *@desc: RadiologyReqModel class + */ class RadiologyReqModel { int patientID; int projectID; diff --git a/lib/models/patient/radiology_res_model.dart b/lib/models/patient/radiology_res_model.dart index 45161195..6c6509a9 100644 --- a/lib/models/patient/radiology_res_model.dart +++ b/lib/models/patient/radiology_res_model.dart @@ -1,3 +1,10 @@ +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: + *@return:RadiologyResModel + *@desc: RadiologyResModel class + */ class RadiologyResModel { String setupID; int projectID; diff --git a/lib/models/patient/vital_sign_res_model.dart b/lib/models/patient/vital_sign_res_model.dart index 70aa135b..6066e4b0 100644 --- a/lib/models/patient/vital_sign_res_model.dart +++ b/lib/models/patient/vital_sign_res_model.dart @@ -1,3 +1,10 @@ +/* + *@author: Elham Rababah + *@Date:6/5/2020 + *@param: + *@return:VitalSignResModel + *@desc: VitalSignResModel class + */ class VitalSignResModel { var transNo; var projectID; diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index bf22e565..0b63f598 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -44,7 +44,7 @@ class PatientsProvider with ChangeNotifier { // var srvicePatiant = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; // print("a=SERVICES_PATIANT[patientType]========='=======a"); int val = int.parse(patientType); - final url ="https://uat.hmgwebservices.com/Services/DoctorApplication.svc/REST/"+ SERVICES_PATIANT[val];///"https://uat.hmgwebservices.com/Services/Doctors.svc/REST/"; + 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]; // print("a===========$url=======a"); diff --git a/lib/routes.dart b/lib/routes.dart index e58f3d4d..1cf0901a 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -40,10 +40,10 @@ const String PHARMACIES_LIST = 'medicine/pharmacies-list'; const String MESSAGES = 'messages'; const String SERVICES = 'services'; const String SETTINGS = 'settings'; -const String VITAL_SIGN = 'vital-sign'; -const String LAB_ORDERS = 'lab_orders'; -const String PRESCRIPTIONS = 'Prescription'; -const String RADIOLOGY = 'Radiology'; +const String VITAL_SIGN = 'patients/vital-sign'; +const String LAB_ORDERS = 'patients/lab_orders'; +const String PRESCRIPTIONS = 'patients/prescription'; +const String RADIOLOGY = 'patients/radiology'; var routes = { diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index fc2eb3d6..979c4158 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -77,7 +77,6 @@ class _PatientsScreenState extends State { if (_isInit) { PatientsProvider patientsProv = Provider.of(context); patientsProv.getPatientList(patient, patientType).then((res) { - print('List_MyInPatient${(res['List_MyInPatient'])}'); setState(() { int val2 = int.parse(patientType); litems = res[SERVICES_PATIANT2[val2]]; From 8594f1a4982a4aa05aeb194ae4932b6bee4ef6c0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 6 May 2020 16:01:25 +0300 Subject: [PATCH 5/8] change the color desing in profile --- .../profile/lab_result/lab_orders_screen.dart | 19 +++++++++++------- .../prescriptions/prescriptions_screen.dart | 20 +++++++++++-------- .../profile/radiology/radiology_screen.dart | 14 ++++++++----- .../profile/vital_sign/vital_sign_screen.dart | 18 ++++++++++------- 4 files changed, 44 insertions(+), 27 deletions(-) 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 c8364296..d26ab4c7 100644 --- a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart +++ b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart @@ -108,9 +108,11 @@ class _LabOrdersScreenState extends State { children: [ Row( children: [ - ProfileImageWidget(url:patientsProv - .patientLabResultOrdersList[index] - .doctorImageURL), + ProfileImageWidget( + url: patientsProv + .patientLabResultOrdersList[ + index] + .doctorImageURL), Expanded( child: Padding( padding: const EdgeInsets.fromLTRB( @@ -123,15 +125,18 @@ class _LabOrdersScreenState extends State { '${patientsProv.patientLabResultOrdersList[index].doctorName}', fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), SizedBox( height: 8, ), AppText( - ' ${patientsProv.patientLabResultOrdersList[index].clinicName}', - fontSize: 2.5 * - SizeConfig - .textMultiplier), + ' ${patientsProv.patientLabResultOrdersList[index].clinicName}', + fontSize: 2 * + SizeConfig.textMultiplier, + color: Theme.of(context) + .primaryColor, + ), SizedBox( height: 8, ), diff --git a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart index 061bf648..47fff706 100644 --- a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart +++ b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart @@ -55,8 +55,7 @@ class _PrescriptionScreenState extends State { tokenID: token, patientTypeID: patient.patientType, languageID: 2, - setupID: 0 - ); + setupID: 0); patientsProv.getPatientPrescriptions(prescriptionReqModel.toJson()); } @@ -99,7 +98,8 @@ class _PrescriptionScreenState extends State { SizeConfig.realScreenWidth * 0.05, 0), child: ListView.builder( - itemCount: patientsProv.patientPrescriptionsList.length, + itemCount: + patientsProv.patientPrescriptionsList.length, itemBuilder: (BuildContext ctxt, int index) { return InkWell( child: CardWithBgWidget( @@ -108,9 +108,10 @@ class _PrescriptionScreenState extends State { children: [ Row( children: [ - ProfileImageWidget(url:patientsProv - .patientPrescriptionsList[index] - .doctorImageURL), + ProfileImageWidget( + url: patientsProv + .patientPrescriptionsList[index] + .doctorImageURL), Expanded( child: Padding( padding: const EdgeInsets.fromLTRB( @@ -123,15 +124,18 @@ class _PrescriptionScreenState extends State { '${patientsProv.patientPrescriptionsList[index].doctorName}', fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), SizedBox( height: 8, ), AppText( ' ${patientsProv.patientPrescriptionsList[index].clinicDescription}', - fontSize: 2.5 * + fontSize: 2 * SizeConfig - .textMultiplier), + .textMultiplier, + color: Theme.of(context) + .primaryColor), SizedBox( height: 8, ), diff --git a/lib/screens/patients/profile/radiology/radiology_screen.dart b/lib/screens/patients/profile/radiology/radiology_screen.dart index a55c2704..8b48e88c 100644 --- a/lib/screens/patients/profile/radiology/radiology_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_screen.dart @@ -123,23 +123,27 @@ class _RadiologyScreenState extends State { '${patientsProv.patientRadiologyList[index].doctorName}', fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold ), SizedBox( height: 8, ), AppText( 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', - fontSize: 2.5 * + fontSize: 2 * SizeConfig.textMultiplier, + ), SizedBox( height: 8, ), AppText( - ' ${patientsProv.patientRadiologyList[index].clinicName}', - fontSize: 2.5 * - SizeConfig - .textMultiplier), + ' ${patientsProv.patientRadiologyList[index].clinicName}', + fontSize: 2 * + SizeConfig.textMultiplier, + color: Theme.of(context) + .primaryColor, + ), SizedBox( height: 8, ), 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 da604792..c5acfeb6 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart @@ -109,9 +109,10 @@ class _VitalSignScreenState extends State { children: [ Row( children: [ - ProfileImageWidget(url:patientsProv - .patientVitalSignList[index] - .doctorImageURL), + ProfileImageWidget( + url: patientsProv + .patientVitalSignList[index] + .doctorImageURL), Expanded( child: Padding( padding: const EdgeInsets.fromLTRB( @@ -124,15 +125,18 @@ class _VitalSignScreenState extends State { '${patientsProv.patientVitalSignList[index].doctorName}', fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, ), SizedBox( height: 8, ), AppText( - ' ${patientsProv.patientVitalSignList[index].clinicName}', - fontSize: 2.5 * - SizeConfig - .textMultiplier), + ' ${patientsProv.patientVitalSignList[index].clinicName}', + fontSize: 2 * + SizeConfig.textMultiplier, + color: Theme.of(context) + .primaryColor, + ), SizedBox( height: 8, ), From 00bce3403e912eadca237f43057d789ba7dcae04 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Wed, 6 May 2020 22:01:34 +0300 Subject: [PATCH 6/8] first step from the vital details --- lib/routes.dart | 7 +- .../vital_sign/vital_sign_details_screen.dart | 70 +++++++++++++++++++ .../profile/vital_sign/vital_sign_screen.dart | 5 +- .../profile/patient_profile_widget.dart | 33 +-------- .../profile/profile_medical_info_widget.dart | 44 ++++++------ 5 files changed, 105 insertions(+), 54 deletions(-) create mode 100644 lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart diff --git a/lib/routes.dart b/lib/routes.dart index 1cf0901a..dcef9fbe 100644 --- a/lib/routes.dart +++ b/lib/routes.dart @@ -16,6 +16,7 @@ import './screens/patients/profile/lab_result/lab_orders_screen.dart'; import './screens/patients/profile/patient_profile_screen.dart'; import './screens/patients/profile/prescriptions/prescriptions_screen.dart'; import './screens/patients/profile/radiology/radiology_screen.dart'; +import './screens/patients/profile/vital_sign/vital_sign_details_screen.dart'; import './screens/patients/profile/vital_sign/vital_sign_screen.dart'; import './screens/profile_screen.dart'; import './screens/settings/settings_screen.dart'; @@ -44,6 +45,8 @@ 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 VITAL_SIGN_DETAILS = 'patients/vital-sign-details'; + var routes = { @@ -68,5 +71,7 @@ var routes = { SERVICES: (_) => ServicesScreen(), LAB_ORDERS:(_)=>LabOrdersScreen(), PRESCRIPTIONS:(_)=>PrescriptionScreen(), - RADIOLOGY:(_)=>RadiologyScreen() + RADIOLOGY:(_)=>RadiologyScreen(), + VITAL_SIGN_DETAILS:(_)=>VitalSignDetailsScreen(), + }; 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 new file mode 100644 index 00000000..223658b2 --- /dev/null +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -0,0 +1,70 @@ +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/patients/profile/profile_medical_info_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +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; + + @override + Widget build(BuildContext context) { + final routeArgs = ModalRoute.of(context).settings.arguments as Map; + vitalSing = routeArgs['vitalSing']; + return AppScaffold( + appBarTitle: "vital Sing ", + body: RoundedContainer( + child: CustomScrollView( + primary: false, + slivers: [ + SliverPadding( + padding: const EdgeInsets.all(10), + sliver: SliverGrid.count( + // childAspectRatio: 200, + crossAxisSpacing: 0, + mainAxisSpacing: 50, + crossAxisCount: 4, + children: [ + CircleAvatarWidget( + des: 'Vital Sign', + url: url + 'heartbeat.png', + + ), + CircleAvatarWidget( + des: 'Vital Sign', + url: url + 'heartbeat.png', + + ), + CircleAvatarWidget( + des: 'Vital Sign', + url: url + 'heartbeat.png', + ), + CircleAvatarWidget( + des: 'Vital Sign', + url: url + 'heartbeat.png', + ), + CircleAvatarWidget( + des: 'Vital Sign', + url: url + 'heartbeat.png', + ), CircleAvatarWidget( + des: 'Vital Sign', + url: url + 'heartbeat.png', + ), CircleAvatarWidget( + des: 'Vital Sign', + url: url + 'heartbeat.png', + ), + ], + ), + ), + ], + ), + // height: 500, + )); + } +} 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 c5acfeb6..570a5aa1 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_screen.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/routes.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -149,7 +150,9 @@ class _VitalSignScreenState extends State { ], ), ), - onTap: () {}, + onTap: () { + Navigator.of(context).pushNamed(VITAL_SIGN_DETAILS,arguments: {'vitalSing':patientsProv.patientVitalSignList[index]}); + }, ); }), ), diff --git a/lib/widgets/patients/profile/patient_profile_widget.dart b/lib/widgets/patients/profile/patient_profile_widget.dart index 72d287b0..4dbcf39b 100644 --- a/lib/widgets/patients/profile/patient_profile_widget.dart +++ b/lib/widgets/patients/profile/patient_profile_widget.dart @@ -15,38 +15,7 @@ import './profile_status_info_widget.dart'; *@desc: Patient Profile Widget */ class PatientProfileWidget extends StatelessWidget { - // Map patient = { - // "ProjectID": 15, - // "ClinicID": null, - // "DoctorID": 70907, - // "PatientID": 3315674, - // "DoctorName": "MOQBIL ABDULLAH AL HODAITHY", - // "DoctorNameN": null, - // "FirstName": "WALEED", - // "MiddleName": "ALI", - // "LastName": "AL-YAZIDI", - // "FirstNameN": null, - // "MiddleNameN": null, - // "LastNameN": null, - // "Gender": 1, - // "DateofBirth": "/Date(534286800000+0300)/", - // "NationalityID": null, - // "MobileNumber": "0500014559", - // "EmailAddress": "unknown@unknown.com", - // "PatientIdentificationNo": "1063236754", - // "NationalityName": "Saudi", - // "NationalityNameN": null, - // "PatientStatusType": null, - // "PatientType": 1, - // "AppointmentDate": "/Date(1587848400000+0300)/", - // "StartTime": "13:00:00", - // "Age": "34 Yr", - // "ClinicDescription": "INTERNAL MEDICINE CLINIC", - // "GenderDescription": "Male", - // "AdmissionDate": "/Date(1587848400000+0300)/", - // "AdmissionNo": "2020008652" - // }; - + PatiantInformtion patient; diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 7817e9b0..2a4e001b 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -79,7 +79,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { ), InkWell( //RADIOLOGY - onTap: () { + onTap: () { navigator(context, RADIOLOGY); }, child: CircleAvatarWidget( @@ -123,26 +123,30 @@ class CircleAvatarWidget extends StatelessWidget { @override Widget build(BuildContext context) { - return Column( - children: [ - Container( - height: height, - width: width, - decoration: new BoxDecoration( - // color: Colors.green, // border color - shape: BoxShape.circle, - border: Border.all(color: Hexcolor('#B7831A'), width: 1.5)), - child: CircleAvatar( - radius: SizeConfig.imageSizeMultiplier * 12, - child: Image.asset(url), - backgroundColor: Colors.transparent, + return Container( + child: Column( + children: [ + Container( + height: height, + width: width, + // width: 50, + // height: 50, + decoration: new BoxDecoration( + // color: Colors.green, // border color + shape: BoxShape.circle, + border: Border.all(color: Hexcolor('#B7831A'), width: 1.5)), + child: CircleAvatar( + radius: SizeConfig.imageSizeMultiplier * 12, + child: Image.asset(url), + backgroundColor: Colors.transparent, + ), ), - ), - SizedBox( - height: 10, - ), - AppText(des) - ], + SizedBox( + height: 10, + ), + AppText(des) + ], + ), ); } } From 51835c231a7b5285a4c031f2d0b5857132504e58 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 7 May 2020 00:42:38 +0300 Subject: [PATCH 7/8] improtant fix in SliverGrid --- .../vital_sign/vital_sign_details_screen.dart | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) 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 223658b2..cf2676d9 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,11 +1,10 @@ -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/patients/profile/profile_medical_info_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; + +import '../../../../config/size_config.dart'; +import '../../../../models/patient/vital_sign_res_model.dart'; +import '../../../../widgets/patients/profile/profile_medical_info_widget.dart'; +import '../../../../widgets/shared/app_scaffold_widget.dart'; +import '../../../../widgets/shared/rounded_container_widget.dart'; class VitalSignDetailsScreen extends StatelessWidget { // VitalSignDetailsScreen({Key key, this.vitalSing}) : super(key: key); @@ -26,9 +25,9 @@ class VitalSignDetailsScreen extends StatelessWidget { SliverPadding( padding: const EdgeInsets.all(10), sliver: SliverGrid.count( - // childAspectRatio: 200, - crossAxisSpacing: 0, - mainAxisSpacing: 50, + childAspectRatio: 0.6, + crossAxisSpacing: 10, + mainAxisSpacing: 20, crossAxisCount: 4, children: [ CircleAvatarWidget( From cabbf03eec33a9f1ffb59bda3b6c7742d1eef44c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Thu, 7 May 2020 16:44:45 +0300 Subject: [PATCH 8/8] vital_sign_details --- .../vital_sign/vital_sign_details_screen.dart | 25 ++++++++++--------- .../profile/profile_medical_info_widget.dart | 6 ++++- lib/widgets/shared/app_texts_widget.dart | 22 ++++++++-------- 3 files changed, 30 insertions(+), 23 deletions(-) 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 cf2676d9..bf4aad6b 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 @@ -19,43 +19,44 @@ class VitalSignDetailsScreen extends StatelessWidget { return AppScaffold( appBarTitle: "vital Sing ", body: RoundedContainer( + height: SizeConfig.realScreenHeight *0.7, child: CustomScrollView( primary: false, slivers: [ SliverPadding( padding: const EdgeInsets.all(10), sliver: SliverGrid.count( - childAspectRatio: 0.6, + childAspectRatio: 0.7, crossAxisSpacing: 10, - mainAxisSpacing: 20, - crossAxisCount: 4, + mainAxisSpacing: 0, + crossAxisCount: 3, children: [ CircleAvatarWidget( - des: 'Vital Sign', + des: 'Body Measurements', url: url + 'heartbeat.png', + ), CircleAvatarWidget( + des: 'Temperature', + url: url + 'heartbeat.png', ), CircleAvatarWidget( - des: 'Vital Sign', + des: 'Pulse', url: url + 'heartbeat.png', ), CircleAvatarWidget( - des: 'Vital Sign', + des: 'Respiration', url: url + 'heartbeat.png', ), CircleAvatarWidget( - des: 'Vital Sign', + des: 'Blood Pressure', url: url + 'heartbeat.png', ), CircleAvatarWidget( - des: 'Vital Sign', - url: url + 'heartbeat.png', - ), CircleAvatarWidget( - des: 'Vital Sign', + des: 'Oxygenation', url: url + 'heartbeat.png', ), CircleAvatarWidget( - des: 'Vital Sign', + des: 'Pain Scale', url: url + 'heartbeat.png', ), ], diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index 2a4e001b..5bf83cf0 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -144,7 +144,11 @@ class CircleAvatarWidget extends StatelessWidget { SizedBox( height: 10, ), - AppText(des) + AppText( + des, + fontSize: 2 * SizeConfig.textMultiplier, + textAlign: TextAlign.center, + ) ], ), ); diff --git a/lib/widgets/shared/app_texts_widget.dart b/lib/widgets/shared/app_texts_widget.dart index db4f1b2c..100f9bd9 100644 --- a/lib/widgets/shared/app_texts_widget.dart +++ b/lib/widgets/shared/app_texts_widget.dart @@ -2,7 +2,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; - // OWNER : Ibrahim albitar // DATE : 12-04-2020 // DESCRIPTION : Customization for Texts in app @@ -19,6 +18,7 @@ class AppText extends StatefulWidget { final double marginBottom; final double marginLeft; final bool visibility; + final TextAlign textAlign; AppText(this.data, {this.color = Colors.black, @@ -30,7 +30,8 @@ class AppText extends StatefulWidget { this.marginRight = 0, this.marginBottom = 0, this.marginLeft = 0, - this.visibility = true}); + this.visibility = true, + this.textAlign}); @override _AppTextState createState() => _AppTextState(); @@ -39,18 +40,19 @@ class AppText extends StatefulWidget { class _AppTextState extends State { @override Widget build(BuildContext context) { - return Visibility( visible: widget.visibility, - child: Container( - margin: widget.margin != null ? EdgeInsets.all(widget.margin) : EdgeInsets.only( - top: widget.marginTop, - right: widget.marginRight, - bottom: widget.marginBottom, - left: widget.marginLeft - ), + child: Container( + margin: widget.margin != null + ? EdgeInsets.all(widget.margin) + : EdgeInsets.only( + top: widget.marginTop, + right: widget.marginRight, + bottom: widget.marginBottom, + left: widget.marginLeft), child: Text( widget.data, + textAlign: widget.textAlign, style: TextStyle( color: widget.color, fontWeight: widget.fontWeight,