diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 28c30e90..0d57b9dd 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -14,6 +14,13 @@ import 'package:http/http.dart'; *@return: *@desc: */ +///Example +/* + await BaseAppClient.post('', + onSuccess: (dynamic response, int statusCode) {}, + onFailure: (String error, int statusCode) {}, + body: null); +* */ class BaseAppClient { static Client client = HttpInterceptor().getClient(); diff --git a/lib/config/config.dart b/lib/config/config.dart index 24c2586a..b3dd7255 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://uat.hmgwebservices.com/Services/'; +const BASE_URL = 'https://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"; diff --git a/lib/main.dart b/lib/main.dart index 98331b4a..2ab87a2a 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -44,7 +44,7 @@ class MyApp extends StatelessWidget { ], theme: ThemeData( primarySwatch: Colors.grey, - primaryColor: Hexcolor('#B8382C'), + primaryColor: Colors.grey, buttonColor: Hexcolor('#B8382C'), fontFamily: 'WorkSans', dividerColor: Colors.grey[200], diff --git a/lib/models/patient/lab_orders_res_model.dart b/lib/models/patient/lab_orders_res_model.dart index 556f0474..48d3dc27 100644 --- a/lib/models/patient/lab_orders_res_model.dart +++ b/lib/models/patient/lab_orders_res_model.dart @@ -5,6 +5,8 @@ *@return:LabOrdersResModel *@desc: LabOrdersResModel class */ +import 'package:doctor_app_flutter/util/helpers.dart'; + class LabOrdersResModel { String setupID; int projectID; @@ -19,7 +21,7 @@ class LabOrdersResModel { int status; String createdBy; Null createdByN; - String createdOn; + DateTime createdOn; String editedBy; Null editedByN; String editedOn; @@ -65,7 +67,7 @@ class LabOrdersResModel { status = json['Status']; createdBy = json['CreatedBy']; createdByN = json['CreatedByN']; - createdOn = json['CreatedOn']; + createdOn = Helpers.convertStringToDate(json['CreatedOn']); editedBy = json['EditedBy']; editedByN = json['EditedByN']; editedOn = json['EditedOn']; diff --git a/lib/models/patient/lab_result.dart b/lib/models/patient/lab_result.dart new file mode 100644 index 00000000..ca753f2d --- /dev/null +++ b/lib/models/patient/lab_result.dart @@ -0,0 +1,124 @@ +class LabResult { + String setupID; + int projectID; + int orderNo; + int lineItemNo; + int packageID; + int testID; + String description; + String resultValue; + String referenceRange; + Null convertedResultValue; + Null convertedReferenceRange; + Null resultValueFlag; + int status; + String createdBy; + Null createdByN; + String createdOn; + String editedBy; + Null editedByN; + String editedOn; + String verifiedBy; + Null verifiedByN; + String verifiedOn; + Null patientID; + int gender; + Null maleInterpretativeData; + Null femaleInterpretativeData; + String testCode; + String statusDescription; + + LabResult( + {this.setupID, + this.projectID, + this.orderNo, + this.lineItemNo, + this.packageID, + this.testID, + this.description, + this.resultValue, + this.referenceRange, + this.convertedResultValue, + this.convertedReferenceRange, + this.resultValueFlag, + this.status, + this.createdBy, + this.createdByN, + this.createdOn, + this.editedBy, + this.editedByN, + this.editedOn, + this.verifiedBy, + this.verifiedByN, + this.verifiedOn, + this.patientID, + this.gender, + this.maleInterpretativeData, + this.femaleInterpretativeData, + this.testCode, + this.statusDescription}); + + LabResult.fromJson(Map json) { + setupID = json['SetupID']; + projectID = json['ProjectID']; + orderNo = json['OrderNo']; + lineItemNo = json['LineItemNo']; + packageID = json['PackageID']; + testID = json['TestID']; + description = json['Description']; + resultValue = json['ResultValue']; + referenceRange = json['ReferenceRange']; + convertedResultValue = json['ConvertedResultValue']; + convertedReferenceRange = json['ConvertedReferenceRange']; + resultValueFlag = json['ResultValueFlag']; + status = json['Status']; + createdBy = json['CreatedBy']; + createdByN = json['CreatedByN']; + createdOn = json['CreatedOn']; + editedBy = json['EditedBy']; + editedByN = json['EditedByN']; + editedOn = json['EditedOn']; + verifiedBy = json['VerifiedBy']; + verifiedByN = json['VerifiedByN']; + verifiedOn = json['VerifiedOn']; + patientID = json['PatientID']; + gender = json['Gender']; + maleInterpretativeData = json['MaleInterpretativeData']; + femaleInterpretativeData = json['FemaleInterpretativeData']; + testCode = json['TestCode']; + statusDescription = json['StatusDescription']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['ProjectID'] = this.projectID; + data['OrderNo'] = this.orderNo; + data['LineItemNo'] = this.lineItemNo; + data['PackageID'] = this.packageID; + data['TestID'] = this.testID; + data['Description'] = this.description; + data['ResultValue'] = this.resultValue; + data['ReferenceRange'] = this.referenceRange; + data['ConvertedResultValue'] = this.convertedResultValue; + data['ConvertedReferenceRange'] = this.convertedReferenceRange; + data['ResultValueFlag'] = this.resultValueFlag; + data['Status'] = this.status; + data['CreatedBy'] = this.createdBy; + data['CreatedByN'] = this.createdByN; + data['CreatedOn'] = this.createdOn; + data['EditedBy'] = this.editedBy; + data['EditedByN'] = this.editedByN; + data['EditedOn'] = this.editedOn; + data['VerifiedBy'] = this.verifiedBy; + data['VerifiedByN'] = this.verifiedByN; + data['VerifiedOn'] = this.verifiedOn; + data['PatientID'] = this.patientID; + data['Gender'] = this.gender; + data['MaleInterpretativeData'] = this.maleInterpretativeData; + data['FemaleInterpretativeData'] = this.femaleInterpretativeData; + data['TestCode'] = this.testCode; + data['StatusDescription'] = this.statusDescription; + return data; + } +} diff --git a/lib/models/patient/lab_result_req_model.dart b/lib/models/patient/lab_result_req_model.dart new file mode 100644 index 00000000..5e58a4a5 --- /dev/null +++ b/lib/models/patient/lab_result_req_model.dart @@ -0,0 +1,68 @@ +class RequestLabResult { + int projectID; + String setupID; + int orderNo; + int invoiceNo; + int patientTypeID; + int languageID; + String stamp; + String iPAdress; + double versionID; + int channel; + String tokenID; + String sessionID; + bool isLoginForDoctorApp; + bool patientOutSA; + + RequestLabResult( + {this.projectID, + this.setupID, + this.orderNo, + this.invoiceNo, + this.patientTypeID, + this.languageID, + this.stamp, + this.iPAdress, + this.versionID, + this.channel, + this.tokenID, + this.sessionID, + this.isLoginForDoctorApp, + this.patientOutSA}); + + RequestLabResult.fromJson(Map json) { + projectID = json['ProjectID']; + setupID = json['SetupID']; + orderNo = json['OrderNo']; + invoiceNo = json['InvoiceNo']; + patientTypeID = json['PatientTypeID']; + languageID = json['LanguageID']; + stamp = json['stamp']; + iPAdress = json['IPAdress']; + versionID = json['VersionID']; + channel = json['Channel']; + tokenID = json['TokenID']; + sessionID = json['SessionID']; + isLoginForDoctorApp = json['IsLoginForDoctorApp']; + patientOutSA = json['PatientOutSA']; + } + + Map toJson() { + final Map data = new Map(); + data['ProjectID'] = this.projectID; + data['SetupID'] = this.setupID; + data['OrderNo'] = this.orderNo; + data['InvoiceNo'] = this.invoiceNo; + data['PatientTypeID'] = this.patientTypeID; + data['LanguageID'] = this.languageID; + data['stamp'] = this.stamp; + data['IPAdress'] = this.iPAdress; + data['VersionID'] = this.versionID; + data['Channel'] = this.channel; + data['TokenID'] = this.tokenID; + data['SessionID'] = this.sessionID; + data['IsLoginForDoctorApp'] = this.isLoginForDoctorApp; + data['PatientOutSA'] = this.patientOutSA; + return data; + } +} diff --git a/lib/providers/patients_provider.dart b/lib/providers/patients_provider.dart index a70be1aa..864c4d72 100644 --- a/lib/providers/patients_provider.dart +++ b/lib/providers/patients_provider.dart @@ -1,7 +1,10 @@ import 'dart:convert'; import 'package:doctor_app_flutter/client/app_client.dart'; +import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/models/patient/lab_orders_res_model.dart'; +import 'package:doctor_app_flutter/models/patient/lab_result.dart'; +import 'package:doctor_app_flutter/models/patient/lab_result_req_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'; @@ -31,6 +34,7 @@ class PatientsProvider with ChangeNotifier { List patientLabResultOrdersList = []; List patientPrescriptionsList = []; List patientRadiologyList = []; + List labResultList = []; var patientProgressNoteList = []; var insuranceApporvalsList = []; @@ -90,9 +94,9 @@ class PatientsProvider with ChangeNotifier { notifyListeners(); } -/* - *@author: Elham Rababah - *@Date:27/4/2020 +/* + *@author: Elham Rababah + *@Date:27/4/2020 *@param: patient *@return: *@desc: getPatientVitalSign @@ -120,19 +124,19 @@ class PatientsProvider with ChangeNotifier { }); if (patientVitalSignList.length > 0) { - List patientVitalSignOrderdSubListTemp = []; + List patientVitalSignOrderdSubListTemp = []; patientVitalSignOrderdSubListTemp = patientVitalSignList; patientVitalSignOrderdSubListTemp .sort((VitalSignResModel a, VitalSignResModel b) { return b.vitalSignDate.microsecondsSinceEpoch - a.vitalSignDate.microsecondsSinceEpoch; }); - patientVitalSignOrderdSubList.clear(); - for(int x =0; x< 20;x++ ){ - patientVitalSignOrderdSubList.add(patientVitalSignOrderdSubListTemp[x]); - + patientVitalSignOrderdSubList.clear(); + for (int x = 0; x < 20; x++) { + patientVitalSignOrderdSubList + .add(patientVitalSignOrderdSubListTemp[x]); } - var asd=""; + var asd = ""; } // patientVitalSignList = res['List_DoctorPatientVitalSign']; } else { @@ -151,8 +155,8 @@ class PatientsProvider with ChangeNotifier { } } -/*@author: Elham Rababah - *@Date:27/4/2020 +/*@author: Elham Rababah + *@Date:27/4/2020 *@param: patient *@return: *@desc: getLabResult Orders @@ -196,8 +200,8 @@ class PatientsProvider with ChangeNotifier { } } -/*@author: Elham Rababah - *@Date:3/5/2020 +/*@author: Elham Rababah + *@Date:3/5/2020 *@param: patient *@return: *@desc: getPatientPrescriptions @@ -242,8 +246,8 @@ class PatientsProvider with ChangeNotifier { } } - /*@author: Elham Rababah - *@Date:12/5/2020 + /*@author: Elham Rababah + *@Date:12/5/2020 *@param: patient *@return: *@desc: getPatientRadiology @@ -256,8 +260,8 @@ class PatientsProvider with ChangeNotifier { throw err; } -/*@author: Elham Rababah - *@Date:3/5/2020 +/*@author: Elham Rababah + *@Date:3/5/2020 *@param: patient *@return: *@desc: getPatientRadiology @@ -366,4 +370,28 @@ class PatientsProvider with ChangeNotifier { handelCatchErrorCase(err); } } + + getLabResult(LabOrdersResModel labOrdersResModel) async { + labResultList.clear(); + isLoading = true; + notifyListeners(); + RequestLabResult requestLabResult = RequestLabResult(); + requestLabResult.sessionID = labOrdersResModel.setupID; + requestLabResult.orderNo = labOrdersResModel.orderNo; + requestLabResult.invoiceNo = labOrdersResModel.invoiceNo; + requestLabResult.patientTypeID = labOrdersResModel.patientType; + await BaseAppClient.post('DoctorApplication.svc/REST/GetPatientLabResults', + onSuccess: (dynamic response, int statusCode) { + isError = false; + isLoading = false; + response['List_GetLabNormal'].forEach((v) { + labResultList.add(new LabResult.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + isError = true; + isLoading = false; + this.error = error; + }, body: requestLabResult.toJson()); + notifyListeners(); + } } 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 ae2bc1d8..66991967 100644 --- a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart +++ b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart @@ -1,4 +1,8 @@ +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -13,6 +17,7 @@ import '../../../../widgets/shared/app_texts_widget.dart'; import '../../../../widgets/shared/card_with_bg_widget.dart'; import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../../../widgets/shared/profile_image_widget.dart'; +import 'lab_result_secreen.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -44,12 +49,6 @@ class _LabOrdersScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; String token = await sharedPref.getString(TOKEN); - // String type = await sharedPref.getString(SLECTED_PATIENT_TYPE); - // int inOutpatientType = 1; - // if (type == '0') { - // inOutpatientType = 2; - // } - // print(type); LabOrdersReqModel labOrdersReqModel = LabOrdersReqModel( patientID: patient.patientId, projectID: patient.projectId, @@ -88,61 +87,150 @@ class _LabOrdersScreenState extends State { 0, SizeConfig.realScreenWidth * 0.05, 0), - child: ListView.builder( - itemCount: - patientsProv.patientLabResultOrdersList.length, - itemBuilder: (BuildContext ctxt, int index) { - return InkWell( - child: CardWithBgWidget( - widget: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - ProfileImageWidget( + child: Container( + margin: EdgeInsets.symmetric(vertical: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(20.0), + ), + ), + child: ListView.builder( + itemCount: + patientsProv.patientLabResultOrdersList.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => LabResult( + labOrders: patientsProv + .patientLabResultOrdersList[index], + ), + ), + ); + }, + child: Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10)), + border: Border( + bottom: BorderSide( + color: Colors.grey, width: 0.5), + top: BorderSide( + color: Colors.grey, width: 0.5), + left: BorderSide( + color: Colors.grey, width: 0.5), + right: BorderSide( + color: Colors.grey, width: 0.5), + ), + ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + LargeAvatar( url: patientsProv .patientLabResultOrdersList[ index] - .doctorImageURL), - Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 8, 0, 0, 0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - '${patientsProv.patientLabResultOrdersList[index].doctorName}', - fontSize: 2.5 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, - ), - SizedBox( - height: 8, - ), - AppText( - ' ${patientsProv.patientLabResultOrdersList[index].clinicName}', - fontSize: 2 * - SizeConfig.textMultiplier, - color: Theme.of(context) - .primaryColor, - ), - SizedBox( - height: 8, - ), - ], + .doctorImageURL, + name: patientsProv + .patientLabResultOrdersList[ + index] + .doctorName, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.fromLTRB( + 8, 0, 0, 0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + '${patientsProv.patientLabResultOrdersList[index].doctorName}', + fontSize: 1.7 * + SizeConfig + .textMultiplier, + fontWeight: FontWeight.w600, + ), + SizedBox( + height: 8, + ), + AppText( + ' ${patientsProv.patientLabResultOrdersList[index].projectName}', + fontSize: 2 * + SizeConfig + .textMultiplier, + color: Colors.grey[800]), + SizedBox( + height: 8, + ), + Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + ' Invoice No :', + fontSize: 2 * + SizeConfig + .textMultiplier, + color: Colors.grey[800], + ), + AppText( + ' ${patientsProv.patientLabResultOrdersList[index].invoiceNo}', + fontSize: 2 * + SizeConfig + .textMultiplier, + color: Colors.grey[800], + ), + ], + ) + ], + ), ), + ) + ], + ), + SizedBox( + height: 3, + ), + Divider( + color: Colors.grey, + ), + SizedBox( + height: 3, + ), + Row( + children: [ + Icon( + EvaIcons.calendar, + color: Colors.grey[700], ), - ) - ], - ), - ], + SizedBox( + width: 10, + ), + Expanded( + child: AppText( + '${Helpers.getDate(patientsProv.patientLabResultOrdersList[index].createdOn)}', + fontSize: 2.0 * + SizeConfig.textMultiplier, + ), + ) + ], + ) + ], + ), ), - ), - onTap: () {}, - ); - }), + ); + }), + ), ), ); } diff --git a/lib/screens/patients/profile/lab_result/lab_result_secreen.dart b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart new file mode 100644 index 00000000..fed749c7 --- /dev/null +++ b/lib/screens/patients/profile/lab_result/lab_result_secreen.dart @@ -0,0 +1,86 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/lab_orders_res_model.dart'; +import 'package:doctor_app_flutter/providers/patients_provider.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:doctor_app_flutter/widgets/doctor/lab_result_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:provider/provider.dart'; + +class LabResult extends StatefulWidget { + final LabOrdersResModel labOrders; + + LabResult({Key key, this.labOrders}); + + @override + _LabResultState createState() => _LabResultState(); +} + +class _LabResultState extends State { + PatientsProvider patientsProv; + bool _isInit = true; + + @override + void didChangeDependencies() { + super.didChangeDependencies(); + if (_isInit) { + patientsProv = Provider.of(context); + patientsProv.getLabResult(widget.labOrders); + // getLabResultOrders(context); + } + _isInit = false; + } + + @override + Widget build(BuildContext context) { + return AppScaffold( + appBarTitle: "Lab Orders", + showAppDrawer: false, + showBottomBar: false, + body: patientsProv.isLoading + ? DrAppCircularProgressIndeicator() + : patientsProv.isError + ? DrAppEmbeddedError(error: patientsProv.error) + : patientsProv.labResultList.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( + children: [ + CardWithBgWidgetNew( + widget: Row( + mainAxisAlignment: + MainAxisAlignment.start, + children: [ + AppText( + ' Invoice No :', + fontSize: + 2 * SizeConfig.textMultiplier, + color: Colors.grey[800], + ), + AppText( + ' ${widget.labOrders.invoiceNo}', + fontSize: + 2 * SizeConfig.textMultiplier, + color: Colors.grey[800], + ), + ], + ), + ), + CardWithBgWidgetNew(widget: LabResultWidget(labResult: patientsProv.labResultList,)) + ], + ), + ), + ); + } +} diff --git a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart index 3bded248..e06d789c 100644 --- a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart +++ b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart @@ -1,3 +1,6 @@ +import 'package:doctor_app_flutter/widgets/patients/profile/large_avatar.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -92,42 +95,34 @@ class _PrescriptionScreenState extends State { child: ListView.builder( itemCount: patientsProv.patientPrescriptionsList.length, - itemBuilder: (BuildContext ctxt, int index) { + itemBuilder: (BuildContext context, int index) { return InkWell( - child: CardWithBgWidget( + child: CardWithBgWidgetNew( widget: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ Row( children: [ - ProfileImageWidget( - url: patientsProv - .patientPrescriptionsList[index] - .doctorImageURL), + LargeAvatar( + url: patientsProv.patientPrescriptionsList[index].doctorImageURL,name:patientsProv.patientPrescriptionsList[index].doctorName ,radius: 10,width: 70,), Expanded( - child: Padding( - padding: const EdgeInsets.fromLTRB( - 8, 0, 0, 0), + child: Container( + margin: EdgeInsets.only(left: 15,right: 15), child: Column( crossAxisAlignment: - CrossAxisAlignment.start, + CrossAxisAlignment.start, children: [ AppText( - '${patientsProv.patientPrescriptionsList[index].doctorName}', - fontSize: 2.5 * - SizeConfig.textMultiplier, - fontWeight: FontWeight.bold, + '${patientsProv.patientPrescriptionsList[index].name}', + fontSize: 2.5 * SizeConfig.textMultiplier, ), SizedBox( height: 8, ), AppText( ' ${patientsProv.patientPrescriptionsList[index].clinicDescription}', - fontSize: 2 * - SizeConfig - .textMultiplier, - color: Theme.of(context) - .primaryColor), + fontSize: 2.5 * SizeConfig.textMultiplier, + color: Theme.of(context).primaryColor), SizedBox( height: 8, ), diff --git a/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart b/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart index 769b40f9..6082edb6 100644 --- a/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart +++ b/lib/screens/patients/profile/vital_sign/body_measurements_screen.dart @@ -4,6 +4,7 @@ import 'package:doctor_app_flutter/models/patient/vital_sign_res_model.dart'; import 'package:doctor_app_flutter/providers/patients_provider.dart'; import 'package:doctor_app_flutter/widgets/patients/vital_sign_details_wideget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/charts/app_time_series_chart.dart'; import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; diff --git a/lib/widgets/doctor/lab_result_widget.dart b/lib/widgets/doctor/lab_result_widget.dart new file mode 100644 index 00000000..73cdba66 --- /dev/null +++ b/lib/widgets/doctor/lab_result_widget.dart @@ -0,0 +1,174 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/models/patient/lab_result.dart'; +import 'package:doctor_app_flutter/widgets/shared/Text.dart'; +import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +class LabResultWidget extends StatefulWidget { + final List labResult; + + LabResultWidget({Key key, this.labResult}); + + @override + _LabResultWidgetState createState() => _LabResultWidgetState(); +} + +class _LabResultWidgetState extends State { + bool _showDetails = true; + + @override + Widget build(BuildContext context) { + return Container( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + 'General Result', + fontSize: 2.5 * SizeConfig.textMultiplier, + fontWeight: FontWeight.bold, + ), + InkWell( + onTap: () { + setState(() { + _showDetails = !_showDetails; + }); + }, + child: Icon(_showDetails + ? Icons.keyboard_arrow_up + : Icons.keyboard_arrow_down)), + ], + ), + Divider( + color: Colors.grey, + height: 0.5, + ), + !_showDetails + ? Container() + : AnimatedContainer( + duration: Duration(microseconds: 200), + child: Container( + margin: EdgeInsets.only(top: 10), + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(10)), + + ), + child: Column( + children: widget.labResult.map((result) { + return Container( + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10)), + border: Border( + bottom: BorderSide( + color: Colors.grey, width: 0.5), + top: BorderSide( + color: Colors.grey, width: 0.5), + left: BorderSide( + color: Colors.grey, width: 0.5), + right: BorderSide( + color: Colors.grey, width: 0.5), + ), + ), + margin: EdgeInsets.only(top: 10), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + 'Description', + color: Colors.white, + ), + ), + height: 60, + ), + ), + Expanded( + child: Container( + color: Hexcolor('#515B5D'), + child: Center( + child: Texts('Value', color: Colors.white), + ), + height: 60), + ), + Expanded( + child: Container( + decoration: BoxDecoration( + color: Hexcolor('#515B5D'), + borderRadius: BorderRadius.only( + topRight: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts('Range', color: Colors.white), + ), + height: 60), + ), + ], + ), + Row( + children: [ + Expanded( + child: Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(10.0), + ), + ), + child: Center( + child: Texts( + '${result.description}', + color: Colors.grey[800], + ), + ), + height: 60, + ), + ), + Expanded( + child: Container( + child: Center( + child: Texts( + '${result.resultValue}', + color: Colors.grey[800]), + ), + height: 60), + ), + Expanded( + child: Container( + child: Center( + child: Texts( + '${result.referenceRange}', + color: Colors.grey[800]), + ), + height: 60), + ), + ], + ) + ], + ), + ); + }).toList(), + ), + ), + ) + ], + ), + ); + } +} diff --git a/lib/widgets/patients/profile/large_avatar.dart b/lib/widgets/patients/profile/large_avatar.dart index ab28b9fe..54cbcb30 100644 --- a/lib/widgets/patients/profile/large_avatar.dart +++ b/lib/widgets/patients/profile/large_avatar.dart @@ -5,23 +5,33 @@ import 'package:flutter/material.dart'; import 'avatar_gradients.dart'; class LargeAvatar extends StatelessWidget { - LargeAvatar({Key key, this.name, this.url, this.disableProfileView: false}) + LargeAvatar( + {Key key, + this.name, + this.url, + this.disableProfileView: false, + this.radius = 60.0, + this.width = 90, + this.height = 90}) : super(key: key); final String name; final String url; final bool disableProfileView; + final double radius; + final double width; + final double height; Widget _getAvatar() { if (url != null && url.isNotEmpty && Uri.parse(url).isAbsolute) { return Center( child: ClipRRect( - borderRadius: BorderRadius.all(Radius.circular(60.0)), + borderRadius: BorderRadius.all(Radius.circular(radius)), child: Image.network( url.trim(), fit: BoxFit.cover, - width: 90.0, - height: 90.0, + width: width, + height: height, ), ), ); @@ -35,7 +45,9 @@ class LargeAvatar extends StatelessWidget { return Center( child: AppText( name[0].toUpperCase(), - color: Colors.white,fontSize: 18,fontWeight: FontWeight.bold, + color: Colors.white, + fontSize: 18, + fontWeight: FontWeight.bold, )); } } @@ -50,24 +62,23 @@ class LargeAvatar extends StatelessWidget { }, child: Container( decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment(-1, -1), - end: Alignment(1, 1), - colors: [ - Colors.grey[100], - Colors.grey[800], - ] - ), - boxShadow: [ - BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) - ], - borderRadius: BorderRadius.all(Radius.circular(50.0)), - ), - width: 90.0, - height: 90.0, + gradient: LinearGradient( + begin: Alignment(-1, -1), + end: Alignment(1, 1), + colors: [ + Colors.grey[100], + Colors.grey[800], + ]), + boxShadow: [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.08), + offset: Offset(0.0, 5.0), + blurRadius: 16.0) + ], + borderRadius: BorderRadius.all(Radius.circular(50.0)), + ), + width: width, + height: height, child: _getAvatar()), ); } diff --git a/lib/widgets/shared/card_with_bgNew_widget.dart b/lib/widgets/shared/card_with_bgNew_widget.dart index de8c3e82..20387615 100644 --- a/lib/widgets/shared/card_with_bgNew_widget.dart +++ b/lib/widgets/shared/card_with_bgNew_widget.dart @@ -20,22 +20,21 @@ class CardWithBgWidgetNew extends StatelessWidget { @override Widget build(BuildContext context) { - ProjectProvider projectProvider = Provider.of(context); return Container( margin: EdgeInsets.symmetric(vertical: 10.0), width: double.infinity, decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(20.0), + borderRadius: BorderRadius.all( + Radius.circular(10.0), + ), ), - ), child: Material( - borderRadius: BorderRadius.all(Radius.circular(20.0)), - color: Hexcolor('#FFFFFF'), + borderRadius: BorderRadius.all(Radius.circular(10.0)), + color: Hexcolor('#FFFFFF'), child: Stack( children: [ Container( - padding: EdgeInsets.all(15.0), + padding: EdgeInsets.all(10.0), margin: EdgeInsets.only(left: 10), child: widget) ],