From a7807a7e6de6a26c2079842fdaf2cebe16732fb6 Mon Sep 17 00:00:00 2001 From: Elham Date: Wed, 29 Apr 2020 12:36:07 +0000 Subject: [PATCH] Revert "Merge branch 'Amjad_search' into 'master'" This reverts merge request !39 --- .vscode/settings.json | 2 +- lib/config/config.dart | 4 +- lib/models/patient/patiant_info_model.dart | 5 ++ .../patients/patient_search_screen.dart | 15 ------ lib/screens/patients/patients_screen.dart | 53 +++++++++++++------ 5 files changed, 43 insertions(+), 36 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 6fa6c5bf..a1b95030 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,7 +1,7 @@ { "commentBox.styles": { "defaultStyle": { - "commentStartToken": "/* \n *@author: Amjad Amireh \n *@Date:28/4/2020 \n *@param: \n *@return:\n *@desc: ", + "commentStartToken": "/* \n *@author: Elham Rababah \n *@Date:13/4/2020 \n *@param: \n *@return:\n *@desc: ", "commentEndToken": "\n */", "leftEdgeToken": " * ", "rightEdgeToken": "", diff --git a/lib/config/config.dart b/lib/config/config.dart index 0a0f7715..ad9ab173 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,7 +5,5 @@ const ONLY_LETTERS = "[a-zA-Z]"; const ONLY_DATE = "[0-9/]"; //*********change value to decode json from Dropdown ************ var SERVICES_PATIANT = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; -var SERVICES_JSON_PATIANT_LIST = ["List_MyOutPatient", "List_MyInPatient","List_MyDischargePatient" ,"List_MyReferredPatient","List_MyDischargeReferralPatient","List_MyTomorrowPatient","List_MyReferralPatient"]; -var SERVICES_PATIANT_HEADER = ["OutPatient", "InPatient", "Discharge","Referred","Referral Discharge","Tomorrow","Referral"]; - +var SERVICES_PATIANT2 = ["List_MyOutPatient", "List_MyInPatient", "List_MyReferredPatient","List_MyReferredPatient","List_MyDischargeReferredPatient","List_MyTomorrowPatient","List_MyReferralPatient"]; //****************** \ No newline at end of file diff --git a/lib/models/patient/patiant_info_model.dart b/lib/models/patient/patiant_info_model.dart index ede3b5c3..94a5c09d 100644 --- a/lib/models/patient/patiant_info_model.dart +++ b/lib/models/patient/patiant_info_model.dart @@ -1,5 +1,10 @@ import 'dart:convert'; +//PatiantInformtion patiantInformtionFromJson(String str) => PatiantInformtion.fromJson(json.decode(str)); + +////String patiantInformtionToJson(PatiantInformtion data) => json.encode(data.toJson()); +//****************************** */ + /* *@author: Amjad Amireh *@Date:27/4/2020 diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 21ab018a..c900a2ff 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -63,20 +63,6 @@ class _PatientSearchScreenState extends State { if (_formKey.currentState.validate()) { // If all data are correct then save data to out variables -<<<<<<< lib/screens/patients/patient_search_screen.dart - // _formKey.currentState.save(); - - sharedPref.getString(TOKEN).then((token) { - _patientSearchFormValues.TokenID = _patientSearchFormValues, - _patientSearchFormValues.ProjectID= _selectedType - - - - Navigator.of(context).pushNamed(PATIENTS, arguments: { - "patientSearchForm": _patientSearchFormValues, - "selectedType": _selectedType - }); -======= // _formKey.currentState.save(); String token = await sharedPref.getString(TOKEN); int projectID = await sharedPref.getInt(PROJECT_ID); @@ -86,7 +72,6 @@ class _PatientSearchScreenState extends State { Navigator.of(context).pushNamed(PATIENTS, arguments: { "patientSearchForm": _patientSearchFormValues, "selectedType": _selectedType ->>>>>>> lib/screens/patients/patient_search_screen.dart }); } else { // If all data are not valid then start auto validation. diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index ec375d37..8b342581 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -33,18 +33,19 @@ class PatientsScreen extends StatefulWidget { class _PatientsScreenState extends State { List litems; - + //******************* List responseModelList; List _locations = ['Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; + //******************* + bool _isInit = true; - String patientType; - String patientTypetitle; + var _isLoading = true; var _hasError; - //******* search box****** + //*******Amjad add to search box****** final _controller = TextEditingController(); //************** PatientModel patient; @@ -52,28 +53,31 @@ class _PatientsScreenState extends State { @override void didChangeDependencies() { final routeArgs = ModalRoute.of(context).settings.arguments as Map; - + //PatientModel patient = routeArgs['patientSearchForm']; patient = routeArgs['patientSearchForm']; - print(patient.TokenID + "EEEEEE"); - - patientType = routeArgs['selectedType']; - patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; + //PatiantInformtion patiantInfo = routeArgs['patientSearchForm']; + print(patient.TokenID + "EEEEEE"); + String patientType = routeArgs['selectedType']; print("**************patiant Type**************"); print(patientType); - + print("**************test**************"); if (_isInit) { + // setState(() {}); PatientsProvider patientsProv = Provider.of(context); patientsProv.getPatientList(patient, patientType).then((res) { + // print('MessageStatus${res['MessageStatus']}'); print('List_MyInPatient${(res['List_MyInPatient'])}'); setState(() { int val2 = int.parse(patientType); - litems = res[SERVICES_JSON_PATIANT_LIST[val2]]; - + litems = res[SERVICES_PATIANT2[val2]]; + //******************** + final List parsed = litems; - - responseModelList = new ModelResponse.fromJson(parsed).list; + + responseModelList = + new ModelResponse.fromJson(parsed).list; //******************** _isLoading = false; _hasError = res['ErrorEndUserMessage']; @@ -92,15 +96,18 @@ class _PatientsScreenState extends State { PatientsProvider patientsProv = Provider.of(context); return AppScaffold( - appBarTitle: patientTypetitle, + appBarTitle: 'Patients', //***********Modify by amjad (create List view to insert all new data webservise in scroll )************* body: Container( child: ListView(scrollDirection: Axis.vertical, children: [ Container( + //child:litems == null?Column():Column(children: [ child: litems == null ? Column() : Column( children: [ + //*********change to test screen************* */ + // child:Column(children: [ Padding( padding: EdgeInsets.only( top: MediaQuery.of(context).size.height * 0.03), @@ -161,12 +168,18 @@ class _PatientsScreenState extends State { ]))); } - //***********amjad update**buildInputDecoration ***to search box******** + //***********amjad update************* InputDecoration buildInputDecoration(BuildContext context, hint) { return InputDecoration( prefixIcon: Icon(Icons.search, color: Colors.red), filled: true, fillColor: Colors.white, + //Image.asset(asset), + /* icon: Padding( + padding: const EdgeInsets.all(8.0), + child: Icon(Icons.search), + ),*/ + hintText: hint, hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), enabledBorder: OutlineInputBorder( @@ -179,12 +192,17 @@ class _PatientsScreenState extends State { )); } + //************* Widget _locationBar(BuildContext _context) { + //********* + + //********* return Container( height: MediaQuery.of(context).size.height * 0.065, width: SizeConfig.screenWidth * 0.80, decoration: BoxDecoration( - color: Color(0Xff59434f), borderRadius: BorderRadius.circular(20)), + color: Color(0Xff59434f), //Color.fromARGB(89, 67, 79,0), + borderRadius: BorderRadius.circular(20)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisSize: MainAxisSize.max, @@ -221,3 +239,4 @@ class _PatientsScreenState extends State { )); } } +//***********************