|
|
|
|
@ -5,7 +5,6 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/AppointmentCardView.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
@ -36,7 +35,8 @@ class _MyAppointmentsState extends State<MyAppointments>
|
|
|
|
|
|
|
|
|
|
bool isDataLoaded = false;
|
|
|
|
|
var sharedPref = new AppSharedPreferences();
|
|
|
|
|
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
|
|
|
|
|
AuthenticatedUserObject authenticatedUserObject =
|
|
|
|
|
locator<AuthenticatedUserObject>();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
@ -241,91 +241,57 @@ class _MyAppointmentsState extends State<MyAppointments>
|
|
|
|
|
|
|
|
|
|
Widget getBookedAppointments() {
|
|
|
|
|
return Container(
|
|
|
|
|
child: Container(
|
|
|
|
|
child: widget.bookedAppoList.length != 0
|
|
|
|
|
? new ListView.builder(
|
|
|
|
|
itemCount: widget.bookedAppoList.length,
|
|
|
|
|
itemBuilder: (context, i) {
|
|
|
|
|
return AppointmentCard(
|
|
|
|
|
appo: widget.bookedAppoList[i],
|
|
|
|
|
onReloadAppointmentHistory: getPatientAppointmentHistory,
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
? SingleChildScrollView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
...List.generate(
|
|
|
|
|
widget._patientBookedAppointmentListHospital.length,
|
|
|
|
|
(index) => AppExpandableNotifier(
|
|
|
|
|
title: widget
|
|
|
|
|
._patientBookedAppointmentListHospital[index]
|
|
|
|
|
.filterName,
|
|
|
|
|
bodyWidget: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: widget
|
|
|
|
|
._patientBookedAppointmentListHospital[index]
|
|
|
|
|
.patientDoctorAppointmentList
|
|
|
|
|
.map((doctor) {
|
|
|
|
|
return AppointmentCard(
|
|
|
|
|
appo: doctor,
|
|
|
|
|
onReloadAppointmentHistory:
|
|
|
|
|
getPatientAppointmentHistory,
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
// Image.asset(
|
|
|
|
|
// "assets/images/new-design/noAppointmentIcon.png"),
|
|
|
|
|
// Container(
|
|
|
|
|
// margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
// child: Text(TranslationBase.of(context).noBookedAppointments,
|
|
|
|
|
// style: TextStyle(
|
|
|
|
|
// fontSize: 16.0,
|
|
|
|
|
// )),
|
|
|
|
|
// ),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: Container(
|
|
|
|
|
child: widget.bookedAppoList.length != 0
|
|
|
|
|
? SingleChildScrollView(
|
|
|
|
|
physics: BouncingScrollPhysics(),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
...List.generate(
|
|
|
|
|
widget._patientBookedAppointmentListHospital
|
|
|
|
|
.length,
|
|
|
|
|
(index) => AppExpandableNotifier(
|
|
|
|
|
title: widget
|
|
|
|
|
._patientBookedAppointmentListHospital[
|
|
|
|
|
index]
|
|
|
|
|
.filterName,
|
|
|
|
|
bodyWidget: Column(
|
|
|
|
|
crossAxisAlignment:
|
|
|
|
|
CrossAxisAlignment.start,
|
|
|
|
|
mainAxisAlignment:
|
|
|
|
|
MainAxisAlignment.spaceBetween,
|
|
|
|
|
children: widget
|
|
|
|
|
._patientBookedAppointmentListHospital[
|
|
|
|
|
index]
|
|
|
|
|
.patientDoctorAppointmentList
|
|
|
|
|
.map((doctor) {
|
|
|
|
|
return AppointmentCard(
|
|
|
|
|
appo: doctor,
|
|
|
|
|
onReloadAppointmentHistory:
|
|
|
|
|
getPatientAppointmentHistory,
|
|
|
|
|
);
|
|
|
|
|
}).toList(),
|
|
|
|
|
)),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
: Container(
|
|
|
|
|
child: Center(
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/new-design/noAppointmentIcon.png"),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: Text("No Booked Appointments",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
)
|
|
|
|
|
],
|
|
|
|
|
))));
|
|
|
|
|
child: Column(
|
|
|
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
|
|
|
children: <Widget>[
|
|
|
|
|
Image.asset(
|
|
|
|
|
"assets/images/new-design/noAppointmentIcon.png"),
|
|
|
|
|
Container(
|
|
|
|
|
margin: EdgeInsets.only(top: 10.0),
|
|
|
|
|
child: Text("No Booked Appointments",
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 16.0,
|
|
|
|
|
)),
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget getConfirmedAppointments() {
|
|
|
|
|
|