|
|
|
|
@ -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<PatientsScreen> {
|
|
|
|
|
List<dynamic> litems;
|
|
|
|
|
|
|
|
|
|
// final List parsed;
|
|
|
|
|
List parsed;
|
|
|
|
|
|
|
|
|
|
//**********
|
|
|
|
|
List date;
|
|
|
|
|
List unfilterDate;
|
|
|
|
|
|
|
|
|
|
//***********
|
|
|
|
|
|
|
|
|
|
List<PatiantInformtion> responseModelList;
|
|
|
|
|
List<PatiantInformtion> responseModelList2;
|
|
|
|
|
@ -59,13 +53,11 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
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<PatientsScreen> {
|
|
|
|
|
|
|
|
|
|
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<PatientsScreen> {
|
|
|
|
|
setState(() {
|
|
|
|
|
_isLoading = true;
|
|
|
|
|
_isError = false;
|
|
|
|
|
error ="";
|
|
|
|
|
error = "";
|
|
|
|
|
});
|
|
|
|
|
patientsProv.getPatientList(patient, patientType).then((res) {
|
|
|
|
|
setState(() {
|
|
|
|
|
@ -105,11 +95,10 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}).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<PatientsScreen> {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//***********DateFormat**************
|
|
|
|
|
/*
|
|
|
|
|
*@author: Amjad Amireh
|
|
|
|
|
*@Date:5/5/2020
|
|
|
|
|
@ -288,26 +276,23 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
return "Old Date";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//*************************
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
PatientsProvider patientsProv = Provider.of<PatientsProvider>(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: <Widget>[
|
|
|
|
|
Container(
|
|
|
|
|
child: litems == null
|
|
|
|
|
? Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
@ -411,11 +396,14 @@ class _PatientsScreenState extends State<PatientsScreen> {
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
))
|
|
|
|
|
])));
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//***********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<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)),
|
|
|
|
|
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: <Widget>[
|
|
|
|
|
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: <Widget>[
|
|
|
|
|
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(),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|