From bc8a90ef2c02e8cdf2ad4d86139696575028f4c0 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 17 Jan 2021 19:43:25 +0200 Subject: [PATCH 1/4] first step from fix loader --- ios/Podfile.lock | 102 ++++++++++++++++++ lib/screens/dashboard_screen.dart | 2 +- .../profile/patient-page-header-widget.dart | 20 ++-- .../subjective/update_subjective_page.dart | 10 +- .../soap_update/update_assessment_page.dart | 10 +- .../soap_update/update_objective_page.dart | 13 ++- .../profile/soap_update/update_plan_page.dart | 6 +- .../soap_update/update_soap_index.dart | 23 +++- .../shared/loader/gif_loader_container.dart | 1 + lib/widgets/shared/network_base_view.dart | 5 +- 10 files changed, 167 insertions(+), 25 deletions(-) diff --git a/ios/Podfile.lock b/ios/Podfile.lock index 108205bf..40d9a06a 100644 --- a/ios/Podfile.lock +++ b/ios/Podfile.lock @@ -13,11 +13,72 @@ PODS: - Flutter - device_info (0.0.1): - Flutter + - Firebase/CoreOnly (6.33.0): + - FirebaseCore (= 6.10.3) + - Firebase/Messaging (6.33.0): + - Firebase/CoreOnly + - FirebaseMessaging (~> 4.7.0) + - firebase_core (0.5.3): + - Firebase/CoreOnly (~> 6.33.0) + - Flutter + - firebase_core_web (0.1.0): + - Flutter + - firebase_messaging (7.0.3): + - Firebase/CoreOnly (~> 6.33.0) + - Firebase/Messaging (~> 6.33.0) + - firebase_core + - Flutter + - FirebaseCore (6.10.3): + - FirebaseCoreDiagnostics (~> 1.6) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Logger (~> 6.7) + - FirebaseCoreDiagnostics (1.7.0): + - GoogleDataTransport (~> 7.4) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Logger (~> 6.7) + - nanopb (~> 1.30906.0) + - FirebaseInstallations (1.7.0): + - FirebaseCore (~> 6.10) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - PromisesObjC (~> 1.2) + - FirebaseInstanceID (4.8.0): + - FirebaseCore (~> 6.10) + - FirebaseInstallations (~> 1.6) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - FirebaseMessaging (4.7.1): + - FirebaseCore (~> 6.10) + - FirebaseInstanceID (~> 4.7) + - GoogleUtilities/AppDelegateSwizzler (~> 6.7) + - GoogleUtilities/Environment (~> 6.7) + - GoogleUtilities/Reachability (~> 6.7) + - GoogleUtilities/UserDefaults (~> 6.7) + - Protobuf (>= 3.9.2, ~> 3.9) - Flutter (1.0.0) - flutter_flexible_toast (0.0.1): - Flutter - flutter_plugin_android_lifecycle (0.0.1): - Flutter + - GoogleDataTransport (7.5.1): + - nanopb (~> 1.30906.0) + - GoogleUtilities/AppDelegateSwizzler (6.7.2): + - GoogleUtilities/Environment + - GoogleUtilities/Logger + - GoogleUtilities/Network + - GoogleUtilities/Environment (6.7.2): + - PromisesObjC (~> 1.2) + - GoogleUtilities/Logger (6.7.2): + - GoogleUtilities/Environment + - GoogleUtilities/Network (6.7.2): + - GoogleUtilities/Logger + - "GoogleUtilities/NSData+zlib" + - GoogleUtilities/Reachability + - "GoogleUtilities/NSData+zlib (6.7.2)" + - GoogleUtilities/Reachability (6.7.2): + - GoogleUtilities/Logger + - GoogleUtilities/UserDefaults (6.7.2): + - GoogleUtilities/Logger - hexcolor (0.0.1): - Flutter - imei_plugin (0.0.1): @@ -27,6 +88,11 @@ PODS: - maps_launcher (0.0.1): - Flutter - MTBBarcodeScanner (5.0.11) + - nanopb (1.30906.0): + - nanopb/decode (= 1.30906.0) + - nanopb/encode (= 1.30906.0) + - nanopb/decode (1.30906.0) + - nanopb/encode (1.30906.0) - OpenTok (2.15.3) - path_provider_linux (0.0.1): - Flutter @@ -34,6 +100,8 @@ PODS: - Flutter - "permission_handler (5.0.1+1)": - Flutter + - PromisesObjC (1.2.10) + - Protobuf (3.13.0) - Reachability (3.2) - shared_preferences (0.0.1): - Flutter @@ -68,6 +136,9 @@ DEPENDENCIES: - connectivity_for_web (from `.symlinks/plugins/connectivity_for_web/ios`) - connectivity_macos (from `.symlinks/plugins/connectivity_macos/ios`) - device_info (from `.symlinks/plugins/device_info/ios`) + - firebase_core (from `.symlinks/plugins/firebase_core/ios`) + - firebase_core_web (from `.symlinks/plugins/firebase_core_web/ios`) + - firebase_messaging (from `.symlinks/plugins/firebase_messaging/ios`) - Flutter (from `Flutter`) - flutter_flexible_toast (from `.symlinks/plugins/flutter_flexible_toast/ios`) - flutter_plugin_android_lifecycle (from `.symlinks/plugins/flutter_plugin_android_lifecycle/ios`) @@ -94,8 +165,19 @@ DEPENDENCIES: SPEC REPOS: trunk: - Alamofire + - Firebase + - FirebaseCore + - FirebaseCoreDiagnostics + - FirebaseInstallations + - FirebaseInstanceID + - FirebaseMessaging + - GoogleDataTransport + - GoogleUtilities - MTBBarcodeScanner + - nanopb - OpenTok + - PromisesObjC + - Protobuf - Reachability - SwiftProtobuf - Try @@ -111,6 +193,12 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/connectivity_macos/ios" device_info: :path: ".symlinks/plugins/device_info/ios" + firebase_core: + :path: ".symlinks/plugins/firebase_core/ios" + firebase_core_web: + :path: ".symlinks/plugins/firebase_core_web/ios" + firebase_messaging: + :path: ".symlinks/plugins/firebase_messaging/ios" Flutter: :path: Flutter flutter_flexible_toast: @@ -161,18 +249,32 @@ SPEC CHECKSUMS: connectivity_for_web: 2b8584556930d4bd490d82b836bcf45067ce345b connectivity_macos: e2e9731b6b22dda39eb1b128f6969d574460e191 device_info: d7d233b645a32c40dfdc212de5cf646ca482f175 + Firebase: 8db6f2d1b2c5e2984efba4949a145875a8f65fe5 + firebase_core: 5d6a02f3d85acd5f8321c2d6d62877626a670659 + firebase_core_web: d501d8b946b60c8af265428ce483b0fff5ad52d1 + firebase_messaging: 0aea2cd5885b65e19ede58ee3507f485c992cc75 + FirebaseCore: d889d9e12535b7f36ac8bfbf1713a0836a3012cd + FirebaseCoreDiagnostics: 770ac5958e1372ce67959ae4b4f31d8e127c3ac1 + FirebaseInstallations: 466c7b4d1f58fe16707693091da253726a731ed2 + FirebaseInstanceID: bd3ffc24367f901a43c063b36c640b345a4a5dd1 + FirebaseMessaging: 5eca4ef173de76253352511aafef774caa1cba2a Flutter: 0e3d915762c693b495b44d77113d4970485de6ec flutter_flexible_toast: 0547e740cae0c33bb7c51bcd931233f4584e1143 flutter_plugin_android_lifecycle: dc0b544e129eebb77a6bfb1239d4d1c673a60a35 + GoogleDataTransport: f56af7caa4ed338dc8e138a5d7c5973e66440833 + GoogleUtilities: 7f2f5a07f888cdb145101d6042bc4422f57e70b3 hexcolor: fdfb9c4258ad96e949c2dbcdf790a62194b8aa89 imei_plugin: cb1af7c223ac2d82dcd1457a7137d93d65d2a3cd local_auth: 25938960984c3a7f6e3253e3f8d962fdd16852bd maps_launcher: eae38ee13a9c3f210fa04e04bb4c073fa4c6ed92 MTBBarcodeScanner: f453b33c4b7dfe545d8c6484ed744d55671788cb + nanopb: 59317e09cf1f1a0af72f12af412d54edf52603fc OpenTok: fde03ecc5ea31fe0a453242847c4ee1f47e1d735 path_provider_linux: 4d630dc393e1f20364f3e3b4a2ff41d9674a84e4 path_provider_windows: a2b81600c677ac1959367280991971cb9a1edb3b permission_handler: eac8e15b4a1a3fba55b761d19f3f4e6b005d15b6 + PromisesObjC: b14b1c6b68e306650688599de8a45e49fae81151 + Protobuf: 3dac39b34a08151c6d949560efe3f86134a3f748 Reachability: 33e18b67625424e47b6cde6d202dce689ad7af96 shared_preferences: af6bfa751691cdc24be3045c43ec037377ada40d shared_preferences_linux: afefbfe8d921e207f01ede8b60373d9e3b566b78 diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 8787eb42..78a27f7e 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -70,7 +70,7 @@ class _DashboardScreenState extends State { DEVICE_TOKEN = token; var request = await sharedPref.getObj(DOCTOR_PROFILE); authProvider.insertDeviceImei(request).then((value) { - print(value['ReturnValue']); + // print(value['ReturnValue']); changeIsLoading(false); }); } diff --git a/lib/widgets/patients/profile/patient-page-header-widget.dart b/lib/widgets/patients/profile/patient-page-header-widget.dart index fd7fd0d8..dd2698a9 100644 --- a/lib/widgets/patients/profile/patient-page-header-widget.dart +++ b/lib/widgets/patients/profile/patient-page-header-widget.dart @@ -1,3 +1,4 @@ +import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; @@ -29,6 +30,12 @@ class PatientPageHeaderWidget extends StatelessWidget { doctorID: '', editedBy: ''); await model.getPatientAllergy(generalGetReqForSOAP); + if (model.allergiesList.length == 0) { + await model.getMasterLookup(MasterKeysService.Allergies); + } + if (model.allergySeverityList.length == 0) { + await model.getMasterLookup(MasterKeysService.AllergySeverity); + } }, builder: (_, model, w) => Container( @@ -84,14 +91,11 @@ class PatientPageHeaderWidget extends StatelessWidget { ), ], ), - NetworkBaseView( - baseViewModel: model, - child: model.patientAllergiesList.isNotEmpty ?AppText( - TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), - color: Color(0xFFB9382C), - fontWeight: FontWeight.bold, - ) : AppText(''), - ), + model.patientAllergiesList.isNotEmpty ?AppText( + TranslationBase.of(context).allergicTO +" : "+model.getAllergicNames(projectViewModel.isArabic), + color: Color(0xFFB9382C), + fontWeight: FontWeight.bold, + ) : AppText(''), ], ), ) diff --git a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart index c998f932..6f058792 100644 --- a/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -30,6 +30,7 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class UpdateSubjectivePage extends StatefulWidget { final Function changePageViewIndex; + final Function changeLoadingState; final List myAllergiesList; final List myHistoryList; final PatiantInformtion patientInfo; @@ -39,7 +40,7 @@ class UpdateSubjectivePage extends StatefulWidget { this.changePageViewIndex, this.myAllergiesList, this.myHistoryList, - this.patientInfo}); + this.patientInfo, this.changeLoadingState}); @override _UpdateSubjectivePageState createState() => _UpdateSubjectivePageState(); @@ -53,6 +54,7 @@ class _UpdateSubjectivePageState extends State { TextEditingController complaintsController = TextEditingController(); final formKey = GlobalKey(); getHistory(SOAPViewModel model) async{ + widget.changeLoadingState(true); GetHistoryReqModel getHistoryReqModel = GetHistoryReqModel( patientMRN: widget.patientInfo.patientMRN, episodeID: widget.patientInfo.episodeNo.toString(), @@ -206,10 +208,13 @@ class _UpdateSubjectivePageState extends State { await getHistory(model); await getAllergies(model); + + widget.changeLoadingState(false); + }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, - baseViewModel: model, + // baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -463,6 +468,7 @@ class _UpdateSubjectivePageState extends State { helpers.showErrorToast(model.error); } } + widget.changeLoadingState(true); widget.changePageViewIndex(1); diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 93d56af2..05813d82 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -29,11 +29,12 @@ class UpdateAssessmentPage extends StatefulWidget { final Function changePageViewIndex; List mySelectedAssessmentList; final PatiantInformtion patientInfo; + final Function changeLoadingState; UpdateAssessmentPage({Key key, this.changePageViewIndex, this.mySelectedAssessmentList, - this.patientInfo}); + this.patientInfo, this.changeLoadingState}); @override _UpdateAssessmentPageState createState() => _UpdateAssessmentPageState(); @@ -92,10 +93,13 @@ class _UpdateAssessmentPageState extends State { widget.mySelectedAssessmentList.add(temMySelectedAssessment); }); } + + widget.changeLoadingState(false); + }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, - baseViewModel: model, + // baseViewModel: model, body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -366,6 +370,8 @@ class _UpdateAssessmentPageState extends State { loading: model.state == ViewState.BusyLocal, onPressed: () async { widget.changePageViewIndex(3); + widget.changeLoadingState(true); + }, ), SizedBox( diff --git a/lib/widgets/patients/profile/soap_update/update_objective_page.dart b/lib/widgets/patients/profile/soap_update/update_objective_page.dart index ab1abd21..fe80a5c3 100644 --- a/lib/widgets/patients/profile/soap_update/update_objective_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_objective_page.dart @@ -29,10 +29,12 @@ import 'package:provider/provider.dart'; class UpdateObjectivePage extends StatefulWidget { final Function changePageViewIndex; + final Function changeLoadingState; + final List mySelectedExamination; final PatiantInformtion patientInfo; UpdateObjectivePage( - {Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo}); + {Key key, this.changePageViewIndex, this.mySelectedExamination, this.patientInfo, this.changeLoadingState}); @override _UpdateObjectivePageState createState() => _UpdateObjectivePageState(); @@ -87,10 +89,13 @@ class _UpdateObjectivePageState extends State { widget.mySelectedExamination.add(tempEam); }); } + + widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( isShowAppBar: false, - baseViewModel: model, + // baseViewModel: model, + body: SingleChildScrollView( physics: ScrollPhysics(), child: Center( @@ -402,9 +407,13 @@ class _UpdateObjectivePageState extends State { if (model.state == ViewState.ErrorLocal) { helpers.showErrorToast(model.error); } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(2); } } else { + widget.changeLoadingState(true); + widget.changePageViewIndex(2); // helpers.showErrorToast(TranslationBase.of(context).requiredMsg); diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index a3c2cdd2..d0e91c8d 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -21,8 +21,9 @@ import 'package:font_awesome_flutter/font_awesome_flutter.dart'; class UpdatePlanPage extends StatefulWidget { final Function changePageViewIndex; final PatiantInformtion patientInfo; + final Function changeLoadingState; - UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo}); + UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); @@ -64,9 +65,10 @@ class _UpdatePlanPageState extends State { progressNoteController.text = helpers .parseHtmlString(model.patientProgressNoteList[0].planNote); } + widget.changeLoadingState(false); }, builder: (_, model, w) => AppScaffold( - baseViewModel: model, + // baseViewModel: model, isShowAppBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 84b8cc61..8235f55a 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -1,5 +1,4 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; -import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; @@ -7,8 +6,8 @@ import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; +import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/steps_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/subjective/update_subjective_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_assessment_page.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/soap_update/update_objective_page.dart'; @@ -30,7 +29,7 @@ class _UpdateSoapIndexState extends State with TickerProviderStateMixin { PageController _controller; int _currentIndex = 0; - List myAllergiesList= List(); + List myAllergiesList = List(); List myHistoryList = List(); List mySelectedExamination = List(); List mySelectedAssessment = List(); @@ -38,6 +37,8 @@ class _UpdateSoapIndexState extends State _controller.jumpToPage(pageIndex); } + bool _isLoading = true; + @override void initState() { // TODO: implement initState @@ -45,13 +46,21 @@ class _UpdateSoapIndexState extends State super.initState(); } + + void changeLoadingState(isLoading) { + setState(() { + _isLoading = isLoading; + }); + } + @override Widget build(BuildContext context) { final routeArgs = ModalRoute.of(context).settings.arguments as Map; PatiantInformtion patient = routeArgs['patient']; return BaseView( builder: (_, model, w) => AppScaffold( - baseViewModel: model, + // baseViewModel: model, + isLoading: _isLoading, appBarTitle: TranslationBase.of(context).healthRecordInformation, body: SingleChildScrollView( child: Column( @@ -97,22 +106,28 @@ class _UpdateSoapIndexState extends State myAllergiesList: myAllergiesList, myHistoryList: myHistoryList, patientInfo: patient, + changeLoadingState:changeLoadingState ), UpdateObjectivePage( changePageViewIndex: changePageViewIndex, mySelectedExamination: mySelectedExamination, patientInfo: patient, + changeLoadingState:changeLoadingState ), UpdateAssessmentPage( changePageViewIndex: changePageViewIndex, mySelectedAssessmentList: mySelectedAssessment, patientInfo: patient, + changeLoadingState:changeLoadingState + ), UpdatePlanPage( changePageViewIndex: changePageViewIndex, patientInfo: patient, + changeLoadingState:changeLoadingState + ) ], ), diff --git a/lib/widgets/shared/loader/gif_loader_container.dart b/lib/widgets/shared/loader/gif_loader_container.dart index b7a20339..b2c2224b 100644 --- a/lib/widgets/shared/loader/gif_loader_container.dart +++ b/lib/widgets/shared/loader/gif_loader_container.dart @@ -34,6 +34,7 @@ class _GifLoaderContainerState extends State child: Container( // margin: EdgeInsets.only(bottom: 40), child: GifImage( + controller: controller1, image: AssetImage( "assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), diff --git a/lib/widgets/shared/network_base_view.dart b/lib/widgets/shared/network_base_view.dart index fbd05870..b8db1546 100644 --- a/lib/widgets/shared/network_base_view.dart +++ b/lib/widgets/shared/network_base_view.dart @@ -27,10 +27,7 @@ class NetworkBaseView extends StatelessWidget { return child; break; case ViewState.Busy: - return Padding( - padding: const EdgeInsets.all(8.0), - child: Center(child: const CircularProgressIndicator()), - ); + return AppLoaderWidget(); break; case ViewState.Error: return Center( From 763d6bb49f09918564a665485cc09957612cecc3 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 18 Jan 2021 10:49:16 +0200 Subject: [PATCH 2/4] finish add loader --- .../medicine/medicine_search_screen.dart | 147 +++++++++--------- lib/screens/patients/patients_screen.dart | 3 +- 2 files changed, 78 insertions(+), 72 deletions(-) diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 3a2ff96c..2c5b8213 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -15,6 +15,7 @@ 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_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; import 'package:permission_handler/permission_handler.dart'; @@ -162,87 +163,86 @@ class _MedicineSearchState extends State { // TODO change it secondary button and add loading AppButton( title: TranslationBase.of(context).search, - onPressed: () { - searchMedicine(context, model); + onPressed: () async{ + await searchMedicine(context, model); + }, ), ], ), ), - NetworkBaseView( - baseViewModel: model, - child: Column( - children: [ - Container( - margin: EdgeInsets.only( - left: SizeConfig.heightMultiplier * 2), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - AppText( + Column( + children: [ + Container( + margin: EdgeInsets.only( + left: SizeConfig.heightMultiplier * 2), + child: Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + AppText( + TranslationBase + .of(context) + .youCanFind + + model.pharmacyItemsList.length + .toString() + + " " + TranslationBase .of(context) - .youCanFind + - model.pharmacyItemsList.length - .toString() + - " " + - TranslationBase - .of(context) - .itemsInSearch, - fontWeight: FontWeight.bold, - ), - ], + .itemsInSearch, + fontWeight: FontWeight.bold, ), - ), - Container( - height: MediaQuery - .of(context) - .size - .height * 0.35, - child: Container( - child: ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - itemCount: - model.pharmacyItemsList == - null - ? 0 - : model - .pharmacyItemsList.length, - itemBuilder: - (BuildContext context, int index) { - return InkWell( - child: MedicineItemWidget( - label: model - .pharmacyItemsList[index] - ["ItemDescription"], - url: model - .pharmacyItemsList[index] - ["ImageSRCUrl"], + ], + ), + ), + Container( + height: MediaQuery + .of(context) + .size + .height * 0.35, + child: Container( + child: ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + itemCount: + model.pharmacyItemsList == + null + ? 0 + : model + .pharmacyItemsList.length, + itemBuilder: + (BuildContext context, int index) { + return InkWell( + child: MedicineItemWidget( + label: model + .pharmacyItemsList[index] + ["ItemDescription"], + url: model + .pharmacyItemsList[index] + ["ImageSRCUrl"], + ), + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + PharmaciesListScreen( + itemID: model + .pharmacyItemsList[ + index]["ItemID"], + url: model + .pharmacyItemsList[ + index]["ImageSRCUrl"]), ), - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - PharmaciesListScreen( - itemID: model - .pharmacyItemsList[ - index]["ItemID"], - url: model - .pharmacyItemsList[ - index]["ImageSRCUrl"]), - ), - ); - }, ); - }, - ), - ), + }, + ); + }, ), - ], - )), + ), + ), + ], + ), ], ), ), @@ -252,7 +252,7 @@ class _MedicineSearchState extends State { ),),); } - searchMedicine(context, MedicineViewModel model) { + searchMedicine(context, MedicineViewModel model) async { FocusScope.of(context).unfocus(); if (myController.text.isNullOrEmpty()) { helpers.showErrorToast(TranslationBase @@ -267,7 +267,12 @@ class _MedicineSearchState extends State { .moreThan3Letter); return; } - model.getMedicineItem(myController.text); + + GifLoaderDialogUtils.showMyDialog(context); + + await model.getMedicineItem(myController.text); + GifLoaderDialogUtils.hideDialog(context); + } startVoiceSearch() { diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 3083a779..a6428c21 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -317,8 +317,9 @@ class _PatientsScreenState extends State { }, builder: (_, model, w) => AppScaffold( appBarTitle: patientTypeTitle, + isLoading: _isLoading, body: _isLoading - ? DrAppCircularProgressIndeicator() + ? Container() : _isError ? DrAppEmbeddedError(error: error) : lItems == null || lItems.length == 0 From 9674eb89d95297dde1923d41e617481e574daf7e Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 18 Jan 2021 14:36:59 +0200 Subject: [PATCH 3/4] add modification on so --- lib/config/localized_values.dart | 7 ++ lib/core/service/SOAP_service.dart | 4 +- lib/core/viewModel/SOAP_view_model.dart | 3 +- .../SOAP/GetGetProgressNoteResModel.dart | 39 +++++++++- lib/util/translations_delegate_base.dart | 15 ++++ .../soap_update/update_assessment_page.dart | 70 ++++++++++------- .../profile/soap_update/update_plan_page.dart | 77 ++++++++++++------- .../soap_update/update_soap_index.dart | 4 + 8 files changed, 157 insertions(+), 62 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d121dd87..78c5d833 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -590,4 +590,11 @@ const Map> localizedValues = { 'allergicTO': {'en': "ALLERGIC TO ", 'ar':" حساس من" }, 'normal': {'en': "Normal", 'ar':"عادي" }, 'abnormal': {'en': "Abnormal", 'ar':" غير عادي" }, + 'nameOrICD': {'en': "Name or ICD", 'ar':"الاسم او  ICD" }, + 'dType': {'en': "Type", 'ar':"النوع" }, + 'addAssessmentDetails': {'en': "Add Assessment Details", 'ar':"أضف تفاصيل التقييم" }, + 'progressNoteSOAP': {'en': "Progress Note", 'ar':"ملاحظة التقدم" }, + 'addProgressNote': {'en': "Add Progress Note", 'ar':"أضف ملاحظة التقدم" }, + 'createdBy': {'en': "Created By :", 'ar':"أضيفت : " }, + 'editedBy': {'en': "Edited By :", 'ar':"عدلت : " }, }; diff --git a/lib/core/service/SOAP_service.dart b/lib/core/service/SOAP_service.dart index e3ab61b2..abb832c7 100644 --- a/lib/core/service/SOAP_service.dart +++ b/lib/core/service/SOAP_service.dart @@ -29,7 +29,7 @@ class SOAPService extends LookupService { List patientAllergiesList = []; List patientHistoryList = []; List patientPhysicalExamList = []; - List patientProgressNoteList = []; + List patientProgressNoteList = []; List patientAssessmentList = []; int episodeID; @@ -284,7 +284,7 @@ class SOAPService extends LookupService { print("Success"); patientProgressNoteList.clear(); response['ProgressNoteList']['entityList'].forEach((v) { - patientProgressNoteList.add(GetGetProgressNoteResModel.fromJson(v)); + patientProgressNoteList.add(GetPatientProgressNoteResModel.fromJson(v)); }); }, onFailure: (String error, int statusCode) { diff --git a/lib/core/viewModel/SOAP_view_model.dart b/lib/core/viewModel/SOAP_view_model.dart index 03500740..1ff23a18 100644 --- a/lib/core/viewModel/SOAP_view_model.dart +++ b/lib/core/viewModel/SOAP_view_model.dart @@ -74,7 +74,7 @@ class SOAPViewModel extends BaseViewModel { List get patientPhysicalExamList => _SOAPService.patientPhysicalExamList; - List get patientProgressNoteList => + List get patientProgressNoteList => _SOAPService.patientProgressNoteList; List get patientAssessmentList => @@ -253,6 +253,7 @@ class SOAPViewModel extends BaseViewModel { masterKeys: MasterKeysService.Allergies, id: element.allergyDiseaseId, typeId: element.allergyDiseaseType); + if(selectedAllergy != null) allergiesString += (isArabic ? selectedAllergy.nameAr : selectedAllergy.nameEn )+ ' , '; }); diff --git a/lib/models/SOAP/GetGetProgressNoteResModel.dart b/lib/models/SOAP/GetGetProgressNoteResModel.dart index bbc184f1..ce6c0a12 100644 --- a/lib/models/SOAP/GetGetProgressNoteResModel.dart +++ b/lib/models/SOAP/GetGetProgressNoteResModel.dart @@ -1,15 +1,39 @@ -class GetGetProgressNoteResModel { +class GetPatientProgressNoteResModel { int appointmentNo; + int createdBy; + String createdByName; + String createdOn; + String dName; + String editedByName; + String editedOn; int episodeId; + String mName; int patientMRN; String planNote; - GetGetProgressNoteResModel( - {this.appointmentNo, this.episodeId, this.patientMRN, this.planNote}); + GetPatientProgressNoteResModel( + {this.appointmentNo, + this.createdBy, + this.createdByName, + this.createdOn, + this.dName, + this.editedByName, + this.editedOn, + this.episodeId, + this.mName, + this.patientMRN, + this.planNote}); - GetGetProgressNoteResModel.fromJson(Map json) { + GetPatientProgressNoteResModel.fromJson(Map json) { appointmentNo = json['appointmentNo']; + createdBy = json['createdBy']; + createdByName = json['createdByName']; + createdOn = json['createdOn']; + dName = json['dName']; + editedByName = json['editedByName']; + editedOn = json['editedOn']; episodeId = json['episodeId']; + mName = json['mName']; patientMRN = json['patientMRN']; planNote = json['planNote']; } @@ -17,7 +41,14 @@ class GetGetProgressNoteResModel { Map toJson() { final Map data = new Map(); data['appointmentNo'] = this.appointmentNo; + data['createdBy'] = this.createdBy; + data['createdByName'] = this.createdByName; + data['createdOn'] = this.createdOn; + data['dName'] = this.dName; + data['editedByName'] = this.editedByName; + data['editedOn'] = this.editedOn; data['episodeId'] = this.episodeId; + data['mName'] = this.mName; data['patientMRN'] = this.patientMRN; data['planNote'] = this.planNote; return data; diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index dd72e58a..c1e9b1b8 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -616,6 +616,21 @@ class TranslationBase { String get patientNoDetailErrMsg => localizedValues['patientNoDetailErrMsg'][locale.languageCode]; + String get nameOrICD => + localizedValues['nameOrICD'][locale.languageCode]; + + String get dType => + localizedValues['dType'][locale.languageCode]; + String get addAssessmentDetails => + localizedValues['addAssessmentDetails'][locale.languageCode]; + String get progressNoteSOAP => + localizedValues['progressNoteSOAP'][locale.languageCode]; + String get addProgressNote => + localizedValues['addProgressNote'][locale.languageCode]; + String get createdBy => + localizedValues['createdBy'][locale.languageCode]; + String get editedBy => + localizedValues['editedBy'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 05813d82..5c0dbc4c 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -1,15 +1,16 @@ import 'package:autocomplete_textfield/autocomplete_textfield.dart'; -import 'package:doctor_app_flutter/client/base_app_client.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/master_lookup_key.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetAssessmentReqModel.dart'; import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/post_assessment_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; @@ -22,6 +23,7 @@ import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body. import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import 'package:provider/provider.dart'; import 'custom_validation_error.dart'; @@ -44,6 +46,7 @@ class _UpdateAssessmentPageState extends State { bool isAssessmentExpand = false; @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) async{ @@ -78,19 +81,23 @@ class _UpdateAssessmentPageState extends State { masterKeys: MasterKeysService.DiagnosisCondition, id: element.conditionID, ); - MySelectedAssessment temMySelectedAssessment = MySelectedAssessment( - appointmentId: element.appointmentNo, - remark: element.remarks, - selectedDiagnosisType: diagnosisType, - selectedDiagnosisCondition: diagnosisCondition, - selectedICD: selectedICD, - doctorID: element.doctorID, - doctorName: element.doctorName, - createdBy: element.createdBy, - icdCode10ID: element.icdCode10ID - ); + if(diagnosisCondition !=null &&diagnosisType !=null && diagnosisCondition!=null) { + MySelectedAssessment temMySelectedAssessment = MySelectedAssessment( + appointmentId: element.appointmentNo, + remark: element.remarks, + selectedDiagnosisType: diagnosisType, + selectedDiagnosisCondition: diagnosisCondition, + selectedICD: selectedICD, + doctorID: element.doctorID, + doctorName: element.doctorName, + createdBy: element.createdBy, + createdOn: element.createdOn, + icdCode10ID: element.icdCode10ID + ); + + widget.mySelectedAssessmentList.add(temMySelectedAssessment); + } - widget.mySelectedAssessmentList.add(temMySelectedAssessment); }); } @@ -197,13 +204,14 @@ class _UpdateAssessmentPageState extends State { CrossAxisAlignment.start, children: [ AppText( - "12".toUpperCase(), + + assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day, fontWeight: FontWeight .bold, fontSize: 16, ), AppText( - "DEC".toUpperCase(), + Helpers.getMonth(assessment.createdOn !=null?DateTime.parse(assessment.createdOn).month:DateTime.now().month).toUpperCase(), fontSize: 10, color: Colors.grey, ), @@ -239,7 +247,9 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - assessment + projectViewModel.isArabic?assessment + .selectedDiagnosisCondition + .nameAr : assessment .selectedDiagnosisCondition .nameEn, fontWeight: FontWeight @@ -253,13 +263,15 @@ class _UpdateAssessmentPageState extends State { MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).type +':', + TranslationBase.of(context).dType+':', fontWeight: FontWeight .bold, fontSize: 16, ), AppText( - assessment + projectViewModel.isArabic?assessment + .selectedDiagnosisType + .nameAr:assessment .selectedDiagnosisType .nameEn, fontSize: 10, @@ -438,6 +450,8 @@ class _AddAssessmentDetailsState extends State { @override Widget build(BuildContext context) { + ProjectViewModel projectViewModel = Provider.of(context); + remarkController.text = widget.mySelectedAssessment.remark ?? ""; appointmentIdController.text = widget.mySelectedAssessment.appointmentId.toString(); @@ -498,7 +512,7 @@ class _AddAssessmentDetailsState extends State { height: 16, ), AppText( - "Add Assessment Details".toUpperCase(), + TranslationBase.of(context).addAssessmentDetails.toUpperCase(), fontWeight: FontWeight.bold, fontSize: 16, ), @@ -538,7 +552,7 @@ class _AddAssessmentDetailsState extends State { } : null, child: widget.mySelectedAssessment.selectedICD == null ? AutoCompleteTextField( - decoration: textFieldSelectorDecoration("Name or ICD", widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), + decoration: textFieldSelectorDecoration(TranslationBase.of(context).nameOrICD, widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), itemSubmitted: (item) => setState(() => widget.mySelectedAssessment.selectedICD = item), key: key, suggestions: model.listOfICD10, @@ -553,7 +567,7 @@ class _AddAssessmentDetailsState extends State { ): TextField( decoration: textFieldSelectorDecoration( widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.code :"Name or ICD", - widget.mySelectedAssessment.selectedICD != null ? widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), + widget.mySelectedAssessment.selectedICD != null ? projectViewModel.isArabic?widget.mySelectedAssessment.selectedICD.nameAr:widget.mySelectedAssessment.selectedICD.nameEn : null, true,icon: EvaIcons.search), enabled: false, ), ), @@ -595,10 +609,12 @@ class _AddAssessmentDetailsState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - "Condition", + TranslationBase.of(context).condition, widget.mySelectedAssessment .selectedDiagnosisCondition != null - ? widget.mySelectedAssessment + ? projectViewModel.isArabic?widget.mySelectedAssessment + .selectedDiagnosisCondition + .nameAr:widget.mySelectedAssessment .selectedDiagnosisCondition .nameEn : null, @@ -645,10 +661,11 @@ class _AddAssessmentDetailsState extends State { : null, child: TextField( decoration: textFieldSelectorDecoration( - "Type", + TranslationBase.of(context).dType, widget.mySelectedAssessment .selectedDiagnosisType != null - ? widget.mySelectedAssessment + ?projectViewModel.isArabic?widget.mySelectedAssessment + .selectedDiagnosisType.nameAr: widget.mySelectedAssessment .selectedDiagnosisType.nameEn : null, true), @@ -764,7 +781,8 @@ class _AddAssessmentDetailsState extends State { if (model.state == ViewState.ErrorLocal) { - helpers.showErrorToast(model.error); + helpers + .showErrorToast(model.error); } else { mySelectedAssessment.icdCode10ID = mySelectedAssessment.selectedICD.code; diff --git a/lib/widgets/patients/profile/soap_update/update_plan_page.dart b/lib/widgets/patients/profile/soap_update/update_plan_page.dart index d0e91c8d..437b86f3 100644 --- a/lib/widgets/patients/profile/soap_update/update_plan_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_plan_page.dart @@ -3,9 +3,11 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteReqModel.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/post_progress_note_request_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; @@ -22,8 +24,14 @@ class UpdatePlanPage extends StatefulWidget { final Function changePageViewIndex; final PatiantInformtion patientInfo; final Function changeLoadingState; + GetPatientProgressNoteResModel patientProgressNote; - UpdatePlanPage({Key key, this.changePageViewIndex, this.patientInfo, this.changeLoadingState}); + UpdatePlanPage( + {Key key, + this.changePageViewIndex, + this.patientInfo, + this.changeLoadingState, + this.patientProgressNote}); @override _UpdatePlanPageState createState() => _UpdatePlanPageState(); @@ -32,7 +40,6 @@ class UpdatePlanPage extends StatefulWidget { class _UpdatePlanPageState extends State { bool isProgressNoteExpand = false; - List progressNoteList; TextEditingController progressNoteController = TextEditingController(text: null); @@ -64,6 +71,12 @@ class _UpdatePlanPageState extends State { if (model.patientProgressNoteList.isNotEmpty) { progressNoteController.text = helpers .parseHtmlString(model.patientProgressNoteList[0].planNote); + widget.patientProgressNote.planNote = progressNoteController.text; + widget.patientProgressNote.createdByName = model.patientProgressNoteList[0].createdByName; + widget.patientProgressNote.createdOn = model.patientProgressNoteList[0].createdOn; + widget.patientProgressNote.editedOn = model.patientProgressNoteList[0].editedOn; + widget.patientProgressNote.editedByName = model.patientProgressNoteList[0].editedByName; + } widget.changeLoadingState(false); }, @@ -87,7 +100,9 @@ class _UpdatePlanPageState extends State { children: [ Row( children: [ - Texts('Progress Note', + Texts(TranslationBase + .of(context) + .progressNoteSOAP, variant: isProgressNoteExpand ? "bodyText" : '', bold: isProgressNoteExpand ? true : false, color: Colors.black), @@ -115,22 +130,24 @@ class _UpdatePlanPageState extends State { ), Column( children: [ - if(model.patientProgressNoteList.isEmpty || progressNoteController.text !='') - Container( - margin: - EdgeInsets.only(left: 10, right: 10, top: 15), - child: TextFields( - hintText: "Add Progress Note", - fontSize: 13.5, - onTapTextFields: () { - openProgressNote(context); - }, - readOnly: true, - // hintColor: Colors.black, - suffixIcon: EvaIcons.plusCircleOutline, - suffixIconColor: AppGlobal.appPrimaryColor, - fontWeight: FontWeight.w600, - // controller: messageController, + if(model.patientProgressNoteList.isEmpty) + Container( + margin: + EdgeInsets.only(left: 10, right: 10, top: 15), + child: TextFields( + hintText: TranslationBase + .of(context) + .addProgressNote, + fontSize: 13.5, + onTapTextFields: () { + openProgressNote(context); + }, + readOnly: true, + // hintColor: Colors.black, + suffixIcon: EvaIcons.plusCircleOutline, + suffixIconColor: AppGlobal.appPrimaryColor, + fontWeight: FontWeight.w600, + // controller: messageController, validator: (value) { if (value == null) return TranslationBase.of(context) @@ -161,12 +178,14 @@ class _UpdatePlanPageState extends State { CrossAxisAlignment.start, children: [ AppText( - "12".toUpperCase(), - fontWeight: FontWeight.bold, + + widget.patientProgressNote.createdOn !=null?DateTime.parse(widget.patientProgressNote.createdOn).day.toString():DateTime.now().day.toString(), + fontWeight: FontWeight + .bold, fontSize: 16, ), AppText( - "DEC".toUpperCase(), + Helpers.getMonth(widget.patientProgressNote.createdOn !=null?(DateTime.parse(widget.patientProgressNote.createdOn).month):DateTime.now().month).toUpperCase(), fontSize: 10, color: Colors.grey, ), @@ -209,12 +228,12 @@ class _UpdatePlanPageState extends State { MainAxisAlignment.start, children: [ AppText( - "Created By : ", + TranslationBase.of(context).createdBy, fontWeight: FontWeight.bold, fontSize: 16, ), AppText( - "Anas Abdullah on 12 De", + widget.patientProgressNote.createdByName??"", fontSize: 10, color: Colors.grey, ), @@ -225,12 +244,12 @@ class _UpdatePlanPageState extends State { MainAxisAlignment.start, children: [ AppText( - "Edited By : ", + TranslationBase.of(context).editedBy, fontWeight: FontWeight.bold, fontSize: 16, ), AppText( - "Rahim on 13 Dec", + widget.patientProgressNote.editedByName??"", fontSize: 10, color: Colors.grey, ), @@ -321,7 +340,7 @@ class _UpdatePlanPageState extends State { height: 16, ), AppText( - "Add Progress Note", + TranslationBase.of(context).addProgressNote, fontWeight: FontWeight.bold, fontSize: 16, ), @@ -331,7 +350,7 @@ class _UpdatePlanPageState extends State { Container( margin: EdgeInsets.only(left: 0, right: 0, top: 15), child: TextFields( - hintText: "Add progress note here", + hintText: TranslationBase.of(context).addProgressNote, fontSize: 13.5, // hintColor: Colors.black, fontWeight: FontWeight.w600, @@ -350,7 +369,7 @@ class _UpdatePlanPageState extends State { height: 10, ), AppButton( - title: "Add".toUpperCase(), + title: TranslationBase.of(context).add.toUpperCase(), onPressed: () { setState(() { print(progressNoteController.text); diff --git a/lib/widgets/patients/profile/soap_update/update_soap_index.dart b/lib/widgets/patients/profile/soap_update/update_soap_index.dart index 8235f55a..7b68b4f3 100644 --- a/lib/widgets/patients/profile/soap_update/update_soap_index.dart +++ b/lib/widgets/patients/profile/soap_update/update_soap_index.dart @@ -1,4 +1,5 @@ import 'package:doctor_app_flutter/core/viewModel/doctor_replay_view_model.dart'; +import 'package:doctor_app_flutter/models/SOAP/GetGetProgressNoteResModel.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_assement.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_examination.dart'; @@ -33,6 +34,8 @@ class _UpdateSoapIndexState extends State List myHistoryList = List(); List mySelectedExamination = List(); List mySelectedAssessment = List(); + + GetPatientProgressNoteResModel patientProgressNote = GetPatientProgressNoteResModel(); changePageViewIndex(pageIndex) { _controller.jumpToPage(pageIndex); } @@ -126,6 +129,7 @@ class _UpdateSoapIndexState extends State UpdatePlanPage( changePageViewIndex: changePageViewIndex, patientInfo: patient, + patientProgressNote: patientProgressNote, changeLoadingState:changeLoadingState ) From eb90fc0161e659c9c9e9d9f288526dd1a3d88371 Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 18 Jan 2021 15:53:53 +0200 Subject: [PATCH 4/4] fix bug in assessment --- .../patients/profile/soap_update/update_assessment_page.dart | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart index 5c0dbc4c..ac1e547e 100644 --- a/lib/widgets/patients/profile/soap_update/update_assessment_page.dart +++ b/lib/widgets/patients/profile/soap_update/update_assessment_page.dart @@ -205,7 +205,7 @@ class _UpdateAssessmentPageState extends State { children: [ AppText( - assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day, + assessment.createdOn !=null?DateTime.parse(assessment.createdOn).day.toString():DateTime.now().day.toString(), fontWeight: FontWeight .bold, fontSize: 16, @@ -722,9 +722,6 @@ class _AddAssessmentDetailsState extends State { null && widget.mySelectedAssessment .selectedICD != null) { - widget.addSelectedAssessment( - widget.mySelectedAssessment, - widget.isUpdate); await submitAssessment( isUpdate: widget.isUpdate, model: model,