|
|
|
|
@ -5,8 +5,10 @@ import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/locator.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
|
@ -52,6 +54,8 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
|
|
|
|
|
|
|
|
|
|
int _currentPage = 0;
|
|
|
|
|
|
|
|
|
|
ToDoCountProviderModel toDoProvider;
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
filterType = FilterType.Clinic;
|
|
|
|
|
@ -72,6 +76,7 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).myAppointmentsList,
|
|
|
|
|
isShowAppBar: true,
|
|
|
|
|
@ -168,6 +173,19 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
|
|
|
|
|
print(err);
|
|
|
|
|
AppToast.showErrorToast(message: err);
|
|
|
|
|
});
|
|
|
|
|
getToDoCount();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
getToDoCount() {
|
|
|
|
|
toDoProvider.setState(0, true, "0");
|
|
|
|
|
ClinicListService service = new ClinicListService();
|
|
|
|
|
service.getActiveAppointmentNo(context).then((res) {
|
|
|
|
|
if (res['MessageStatus'] == 1) {
|
|
|
|
|
toDoProvider.setState(res['AppointmentActiveNumber'], true, "0");
|
|
|
|
|
} else {}
|
|
|
|
|
}).catchError((err) {
|
|
|
|
|
print(err);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool isConfirmed(AppoitmentAllHistoryResultList appo) {
|
|
|
|
|
@ -379,7 +397,9 @@ class _MyAppointmentsState extends State<MyAppointments> with SingleTickerProvid
|
|
|
|
|
date: DateUtil.convertStringToDate(_appointmentResult.appointmentDate),
|
|
|
|
|
isSortByClinic: _isSortByClinic,
|
|
|
|
|
rating: _appointmentResult.actualDoctorRate + 0.0,
|
|
|
|
|
appointmentTime: _appointmentResult.isLiveCareAppointment ? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5) : _appointmentResult.startTime.substring(0, 5),
|
|
|
|
|
appointmentTime: _appointmentResult.isLiveCareAppointment
|
|
|
|
|
? DateUtil.convertStringToDate(_appointmentResult.appointmentDate).toString().split(" ")[1].substring(0, 5)
|
|
|
|
|
: _appointmentResult.startTime.substring(0, 5),
|
|
|
|
|
// appointmentTime: _appointmentResult.startTime.substring(0, 5),
|
|
|
|
|
remainingTimeInMinutes: (_appointmentResult.patientStatusType == AppointmentType.BOOKED || _appointmentResult.patientStatusType == AppointmentType.CONFIRMED)
|
|
|
|
|
? _appointmentResult.remaniningHoursTocanPay
|
|
|
|
|
|