Patiant search dropdown design

merge-requests/42/head
Amjad Amireh 6 years ago
parent 376c85a82e
commit 3e25f2c0f4

@ -5,5 +5,6 @@ const ONLY_LETTERS = "[a-zA-Z]";
const ONLY_DATE = "[0-9/]"; const ONLY_DATE = "[0-9/]";
//*********change value to decode json from Dropdown ************ //*********change value to decode json from Dropdown ************
var SERVICES_PATIANT = ["GetMyOutPatient", "GetMyInPatient", "GtMyDischargePatient","GtMyReferredPatient","GtMyDischargeReferralPatient","GtMyTomorrowPatient","GtMyReferralPatient"]; 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"];
//****************** //******************

@ -33,15 +33,14 @@ class PatientsScreen extends StatefulWidget {
class _PatientsScreenState extends State<PatientsScreen> { class _PatientsScreenState extends State<PatientsScreen> {
List<dynamic> litems; List<dynamic> litems;
//*******************
List<PatiantInformtion> responseModelList; List<PatiantInformtion> responseModelList;
List<String> _locations = ['Today', 'Tomorrow', 'Next Week']; List<String> _locations = ['Today', 'Tomorrow', 'Next Week'];
int _activeLocation = 0; int _activeLocation = 0;
//*******************
bool _isInit = true; bool _isInit = true;
String patientType;
String patientTypetitle;
var _isLoading = true; var _isLoading = true;
var _hasError; var _hasError;
@ -53,31 +52,28 @@ class _PatientsScreenState extends State<PatientsScreen> {
@override @override
void didChangeDependencies() { void didChangeDependencies() {
final routeArgs = ModalRoute.of(context).settings.arguments as Map; 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"); print(patient.TokenID + "EEEEEE");
String patientType = routeArgs['selectedType'];
patientType = routeArgs['selectedType'];
patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)];
print("**************patiant Type**************"); print("**************patiant Type**************");
print(patientType); print(patientType);
print("**************test**************");
if (_isInit) { if (_isInit) {
// setState(() {});
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context); PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
patientsProv.getPatientList(patient, patientType).then((res) { patientsProv.getPatientList(patient, patientType).then((res) {
// print('MessageStatus${res['MessageStatus']}');
print('List_MyInPatient${(res['List_MyInPatient'])}'); print('List_MyInPatient${(res['List_MyInPatient'])}');
setState(() { setState(() {
int val2 = int.parse(patientType); int val2 = int.parse(patientType);
litems = res[SERVICES_PATIANT2[val2]]; litems = res[SERVICES_PATIANT2[val2]];
//********************
final List parsed = litems; final List parsed = litems;
responseModelList = responseModelList = new ModelResponse.fromJson(parsed).list;
new ModelResponse.fromJson(parsed).list;
//******************** //********************
_isLoading = false; _isLoading = false;
_hasError = res['ErrorEndUserMessage']; _hasError = res['ErrorEndUserMessage'];
@ -96,18 +92,15 @@ class _PatientsScreenState extends State<PatientsScreen> {
PatientsProvider patientsProv = Provider.of<PatientsProvider>(context); PatientsProvider patientsProv = Provider.of<PatientsProvider>(context);
return AppScaffold( return AppScaffold(
appBarTitle: 'Patients', appBarTitle: patientTypetitle,
//***********Modify by amjad (create List view to insert all new data webservise in scroll )************* //***********Modify by amjad (create List view to insert all new data webservise in scroll )*************
body: Container( body: Container(
child: ListView(scrollDirection: Axis.vertical, children: <Widget>[ child: ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container( Container(
//child:litems == null?Column():Column(children: <Widget>[
child: litems == null child: litems == null
? Column() ? Column()
: Column( : Column(
children: <Widget>[ children: <Widget>[
//*********change to test screen************* */
// child:Column(children: <Widget>[
Padding( Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height * 0.03), top: MediaQuery.of(context).size.height * 0.03),
@ -168,18 +161,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
]))); ])));
} }
//***********amjad update************* //***********amjad update**buildInputDecoration ***to search box********
InputDecoration buildInputDecoration(BuildContext context, hint) { InputDecoration buildInputDecoration(BuildContext context, hint) {
return InputDecoration( return InputDecoration(
prefixIcon: Icon(Icons.search, color: Colors.red), prefixIcon: Icon(Icons.search, color: Colors.red),
filled: true, filled: true,
fillColor: Colors.white, fillColor: Colors.white,
//Image.asset(asset),
/* icon: Padding(
padding: const EdgeInsets.all(8.0),
child: Icon(Icons.search),
),*/
hintText: hint, hintText: hint,
hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier), hintStyle: TextStyle(fontSize: 2 * SizeConfig.textMultiplier),
enabledBorder: OutlineInputBorder( enabledBorder: OutlineInputBorder(
@ -192,17 +179,12 @@ class _PatientsScreenState extends State<PatientsScreen> {
)); ));
} }
//*************
Widget _locationBar(BuildContext _context) { Widget _locationBar(BuildContext _context) {
//*********
//*********
return Container( return Container(
height: MediaQuery.of(context).size.height * 0.065, height: MediaQuery.of(context).size.height * 0.065,
width: SizeConfig.screenWidth * 0.80, width: SizeConfig.screenWidth * 0.80,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0Xff59434f), //Color.fromARGB(89, 67, 79,0), color: Color(0Xff59434f), borderRadius: BorderRadius.circular(20)),
borderRadius: BorderRadius.circular(20)),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -239,4 +221,3 @@ class _PatientsScreenState extends State<PatientsScreen> {
)); ));
} }
} }
//***********************

Loading…
Cancel
Save