From 3e25f2c0f42c9ba910eb506ddc5632f4b8da068a Mon Sep 17 00:00:00 2001 From: Amjad Amireh Date: Wed, 29 Apr 2020 16:29:18 +0300 Subject: [PATCH] Patiant search dropdown design --- lib/config/config.dart | 3 +- lib/screens/patients/patients_screen.dart | 51 +++++++---------------- 2 files changed, 18 insertions(+), 36 deletions(-) diff --git a/lib/config/config.dart b/lib/config/config.dart index ad9ab173..e6c83c36 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -5,5 +5,6 @@ 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_PATIANT2 = ["List_MyOutPatient", "List_MyInPatient", "List_MyReferredPatient","List_MyReferredPatient","List_MyDischargeReferredPatient","List_MyTomorrowPatient","List_MyReferralPatient"]; +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"]; //****************** \ No newline at end of file diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 8b342581..f49e4417 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -33,15 +33,14 @@ 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; @@ -53,31 +52,28 @@ class _PatientsScreenState extends State { @override void didChangeDependencies() { final routeArgs = ModalRoute.of(context).settings.arguments as Map; - //PatientModel patient = routeArgs['patientSearchForm']; - patient = routeArgs['patientSearchForm']; - //PatiantInformtion patiantInfo = routeArgs['patientSearchForm']; + patient = routeArgs['patientSearchForm']; print(patient.TokenID + "EEEEEE"); - String patientType = routeArgs['selectedType']; + + patientType = routeArgs['selectedType']; + patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; + 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_PATIANT2[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']; @@ -96,18 +92,15 @@ class _PatientsScreenState extends State { PatientsProvider patientsProv = Provider.of(context); return AppScaffold( - appBarTitle: 'Patients', + appBarTitle: patientTypetitle, //***********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), @@ -168,18 +161,12 @@ class _PatientsScreenState extends State { ]))); } - //***********amjad update************* + //***********amjad update**buildInputDecoration ***to search box******** 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( @@ -192,17 +179,12 @@ 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), //Color.fromARGB(89, 67, 79,0), - borderRadius: BorderRadius.circular(20)), + color: Color(0Xff59434f), borderRadius: BorderRadius.circular(20)), child: Row( mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisSize: MainAxisSize.max, @@ -239,4 +221,3 @@ class _PatientsScreenState extends State { )); } } -//***********************