diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 5bc54bd7..bde277ee 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -151,7 +151,7 @@ DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); patientList = []; }); String token = await sharedPref.getString(TOKEN); - patient.PatientID = 3120269; + patient.PatientID = 8808; patient.TokenID = token; Provider.of(context, listen: false) .getPatientList(patient, "1") diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index b1dd224c..d10512a2 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -17,14 +17,11 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_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:flutter/material.dart'; -import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; -//************* import '../../config/size_config.dart'; import 'package:hexcolor/hexcolor.dart'; -//******** import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/card_with_bg_widget.dart'; @@ -38,14 +35,11 @@ class PatientsScreen extends StatefulWidget { class _PatientsScreenState extends State { List litems; - // final List parsed; List parsed; - //********** List date; List unfilterDate; - //*********** List responseModelList; List responseModelList2; @@ -59,13 +53,11 @@ class _PatientsScreenState extends State { String patientTypetitle; var _isLoading = false; - bool _isError =true; - String error =""; + bool _isError = true; + String error = ""; - //*******Amjad add to search box****** final _controller = TextEditingController(); - //************** PatientModel patient; PatientsProvider patientsProv; @@ -75,8 +67,6 @@ class _PatientsScreenState extends State { patient = routeArgs['patientSearchForm']; - print(patient.TokenID + "EEEEEE"); - patientType = routeArgs['selectedType']; patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; @@ -87,7 +77,7 @@ class _PatientsScreenState extends State { setState(() { _isLoading = true; _isError = false; - error =""; + error = ""; }); patientsProv.getPatientList(patient, patientType).then((res) { setState(() { @@ -105,11 +95,10 @@ class _PatientsScreenState extends State { } }); }).catchError((error) { - setState(() { - _isError = true; - this.error = helpers.generateContactAdminMsg(error); - }); - + setState(() { + _isError = true; + this.error = helpers.generateContactAdminMsg(error); + }); }); } @@ -152,7 +141,6 @@ class _PatientsScreenState extends State { } } -//***********DateFormat************** /* *@author: Amjad Amireh *@Date:5/5/2020 @@ -288,26 +276,23 @@ class _PatientsScreenState extends State { return "Old Date"; } -//************************* @override Widget build(BuildContext context) { PatientsProvider patientsProv = Provider.of(context); return AppScaffold( - appBarTitle: patientTypetitle, - //***********Modify by amjad (create List view to insert all new data webservise in scroll )************* - body: _isLoading - ? DrAppCircularProgressIndeicator() - : _isError - ? DrAppEmbeddedError(error:error) - : litems == null - ? DrAppEmbeddedError( - error: 'You don\'t have any patient') - : Container( - child: - ListView(scrollDirection: Axis.vertical, children: < - Widget>[ - Container( + appBarTitle: patientTypetitle, + body: _isLoading + ? DrAppCircularProgressIndeicator() + : _isError + ? DrAppEmbeddedError(error: error) + : litems == null + ? DrAppEmbeddedError(error: 'You don\'t have any patient') + : Container( + child: ListView( + scrollDirection: Axis.vertical, + children: [ + Container( child: litems == null ? Column( children: [ @@ -411,11 +396,14 @@ class _PatientsScreenState extends State { ), ), ], - )) - ]))); + ), + ) + ], + ), + ), + ); } - //***********amjad update**buildInputDecoration ***to search box******** InputDecoration buildInputDecoration(BuildContext context, hint) { return InputDecoration( prefixIcon: Icon(Icons.search, color: Colors.red), @@ -435,45 +423,46 @@ 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)), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - mainAxisSize: MainAxisSize.max, - crossAxisAlignment: CrossAxisAlignment.center, - children: _locations.map((item) { - bool _isActive = _locations[_activeLocation] == item ? true : false; - return Column(mainAxisSize: MainAxisSize.min, children: [ - InkWell( - child: Text( - item, - style: TextStyle( - fontSize: 15, - color: Colors.white, - fontWeight: FontWeight.bold), - ), - onTap: () { - print(_locations.indexOf(item)); - - filterBooking(item.toString()); - - setState(() { - _activeLocation = _locations.indexOf(item); - }); - }), - _isActive - ? Container( - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - color: Colors.white), - height: 3, - width: 80, - ) - : Container() - ]); - }).toList(), - )); + height: MediaQuery.of(context).size.height * 0.065, + width: SizeConfig.screenWidth * 0.80, + decoration: BoxDecoration( + color: Color(0Xff59434f), borderRadius: BorderRadius.circular(20)), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + mainAxisSize: MainAxisSize.max, + crossAxisAlignment: CrossAxisAlignment.center, + children: _locations.map((item) { + bool _isActive = _locations[_activeLocation] == item ? true : false; + return Column(mainAxisSize: MainAxisSize.min, children: [ + InkWell( + child: Text( + item, + style: TextStyle( + fontSize: 15, + color: Colors.white, + fontWeight: FontWeight.bold), + ), + onTap: () { + print(_locations.indexOf(item)); + + filterBooking(item.toString()); + + setState(() { + _activeLocation = _locations.indexOf(item); + }); + }), + _isActive + ? Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + color: Colors.white), + height: 3, + width: 80, + ) + : Container() + ]); + }).toList(), + ), + ); } }