|
|
|
@ -33,18 +33,19 @@ class PatientsScreen extends StatefulWidget {
|
|
|
|
|
|
|
|
|
|
class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
List<dynamic> litems;
|
|
|
|
|
|
|
|
|
|
//*******************
|
|
|
|
|
List<PatiantInformtion> responseModelList;
|
|
|
|
|
List<String> _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<PatientsScreen> {
|
|
|
|
|
@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<PatientsProvider>(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<PatientsScreen> {
|
|
|
|
|
PatientsProvider patientsProv = Provider.of<PatientsProvider>(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: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
//child:litems == null?Column():Column(children: <Widget>[
|
|
|
|
|
child: litems == null
|
|
|
|
|
? Column()
|
|
|
|
|
: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
//*********change to test screen************* */
|
|
|
|
|
// child:Column(children: <Widget>[
|
|
|
|
|
Padding(
|
|
|
|
|
padding: EdgeInsets.only(
|
|
|
|
|
top: MediaQuery.of(context).size.height * 0.03),
|
|
|
|
@ -161,12 +168,18 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
])));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//***********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<PatientsScreen> {
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//*************
|
|
|
|
|
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<PatientsScreen> {
|
|
|
|
|
));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
//***********************
|
|
|
|
|