|
|
|
|
@ -1,10 +1,12 @@
|
|
|
|
|
import 'dart:developer';
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:barcode_scan2/barcode_scan2.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/enum/PayfortEnums.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/model/privilege/ProjectDetailListModel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
|
|
|
|
|
@ -34,15 +36,18 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/location_util.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/penguin_method_channel.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/uitl/utils_new.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/bottom_options/bottom_sheet.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/my_rich_text.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
|
|
|
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
|
|
|
|
@ -50,6 +55,7 @@ import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:flutter_countdown_timer/countdown_timer_controller.dart';
|
|
|
|
|
import 'package:flutter_countdown_timer/current_remaining_time.dart';
|
|
|
|
|
import 'package:flutter_countdown_timer/flutter_countdown_timer.dart';
|
|
|
|
|
import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
|
|
|
|
|
import 'package:flutter_rating_bar/flutter_rating_bar.dart';
|
|
|
|
|
import 'package:flutter_svg/flutter_svg.dart';
|
|
|
|
|
import 'package:permission_handler/permission_handler.dart';
|
|
|
|
|
@ -97,6 +103,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
List<AncillaryOrdersListModel> ancillaryLists = [];
|
|
|
|
|
List<OBGyneProcedureListResponse> obGyneAppoList = [];
|
|
|
|
|
String? transID;
|
|
|
|
|
bool _supportsNFC = false;
|
|
|
|
|
late LocationUtils locationUtils;
|
|
|
|
|
ProjectDetailListModel projectDetailListModel = ProjectDetailListModel();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
void initState() {
|
|
|
|
|
@ -124,6 +133,9 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
|
toDoProvider = Provider.of<ToDoCountProviderModel>(context);
|
|
|
|
|
projectViewModel = Provider.of(context);
|
|
|
|
|
FlutterNfcKit.nfcAvailability.then((value) {
|
|
|
|
|
_supportsNFC = (value == NFCAvailability.available);
|
|
|
|
|
});
|
|
|
|
|
return AppScaffold(
|
|
|
|
|
appBarTitle: TranslationBase.of(context).todoList,
|
|
|
|
|
imagesInfo: imagesInfo,
|
|
|
|
|
@ -441,6 +453,23 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
isLiveCareAppointment: false,
|
|
|
|
|
date: DateUtil.convertStringToDate(ancillaryLists[0].ancillaryOrderList![index].orderDate),
|
|
|
|
|
isSortByClinic: true,
|
|
|
|
|
isAllowCheckInAncillary: ancillaryLists[0].ancillaryOrderList![index].isAllowCheckIn!,
|
|
|
|
|
onAncillaryCheckInTap: () {
|
|
|
|
|
AppoitmentAllHistoryResultList appo = new AppoitmentAllHistoryResultList();
|
|
|
|
|
appo.doctorTitle = TranslationBase.of(context).dr.toString();
|
|
|
|
|
appo.doctorNameObj = ancillaryLists[0].ancillaryOrderList![index].doctorName;
|
|
|
|
|
appo.doctorID = ancillaryLists[0].ancillaryOrderList![index].doctorID;
|
|
|
|
|
appo.doctorImageURL = "https://hmgwebservices.com/Images/MobileImages/DUBAI/unkown.png";
|
|
|
|
|
appo.doctorSpeciality = [""];
|
|
|
|
|
appo.projectName = ancillaryLists[0].projectName;
|
|
|
|
|
appo.appointmentDate = ancillaryLists[0].ancillaryOrderList![index].orderDate;
|
|
|
|
|
appo.isLiveCareAppointment = true;
|
|
|
|
|
appo.doctorRate = 5;
|
|
|
|
|
appo.actualDoctorRate = 0;
|
|
|
|
|
appo.noOfPatientsRate = 0;
|
|
|
|
|
|
|
|
|
|
navigateToQR(context, "", new PatientShareResponse(), appo, true);
|
|
|
|
|
},
|
|
|
|
|
);
|
|
|
|
|
},
|
|
|
|
|
itemCount: ancillaryLists[0].ancillaryOrderList!.length,
|
|
|
|
|
@ -1150,7 +1179,7 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
patientShareResponse.clinicID = appo.clinicID;
|
|
|
|
|
patientShareResponse.projectID = appo.projectID;
|
|
|
|
|
patientShareResponse.isFollowup = appo.isFollowup;
|
|
|
|
|
navigateToQR(context, "", patientShareResponse, appo);
|
|
|
|
|
navigateToQR(context, "", patientShareResponse, appo, false);
|
|
|
|
|
projectViewModel.analytics.todoList.to_do_list_check_in(appo);
|
|
|
|
|
// } else {
|
|
|
|
|
// Utils.showErrorToast(TranslationBase.of(context).NFCNotSupported);
|
|
|
|
|
@ -1164,9 +1193,83 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Future navigateToQR(context, String appoQR, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appintment) async {
|
|
|
|
|
Navigator.push(context, FadePage(page: QRCode(patientShareResponse: patientShareResponse, appoQR: appoQR, appointment: appintment))).then((value) {
|
|
|
|
|
getPatientAppointmentHistory();
|
|
|
|
|
Future navigateToQR(context, String appoQR, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appintment, bool isAncillaryOrderCheckIn) async {
|
|
|
|
|
showMyBottomSheet(context,
|
|
|
|
|
callBackFunc: () {},
|
|
|
|
|
child: Padding(
|
|
|
|
|
padding: const EdgeInsets.all(21.0),
|
|
|
|
|
child: Column(
|
|
|
|
|
children: [
|
|
|
|
|
Text(TranslationBase.of(context).scanQRHospital,
|
|
|
|
|
style: TextStyle(
|
|
|
|
|
fontSize: 20,
|
|
|
|
|
fontWeight: FontWeight.w600,
|
|
|
|
|
letterSpacing: -0.48,
|
|
|
|
|
)),
|
|
|
|
|
mHeight(21),
|
|
|
|
|
GridView(
|
|
|
|
|
physics: const NeverScrollableScrollPhysics(),
|
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
|
|
|
|
crossAxisCount: (MediaQuery.of(context).size.width < 550) ? 3 : 5, childAspectRatio: 1 / 1, crossAxisSpacing: 8, mainAxisSpacing: 12),
|
|
|
|
|
children: [
|
|
|
|
|
attendanceMethod(TranslationBase.of(context).scanNFC, "assets/images/nfc/contactless.svg", true, () {
|
|
|
|
|
if (_supportsNFC) {
|
|
|
|
|
Future.delayed(const Duration(milliseconds: 500), () {
|
|
|
|
|
showNfcReader(context, onNcfScan: (String nfcId) {
|
|
|
|
|
Future.delayed(const Duration(milliseconds: 100), () {
|
|
|
|
|
print(nfcId);
|
|
|
|
|
// getProjectIDFromNFC(nfcId, true);
|
|
|
|
|
// Navigator.push(context, FadePage(page: EROnlineCheckInPaymentDetails()));
|
|
|
|
|
});
|
|
|
|
|
}, onCancel: () {
|
|
|
|
|
Navigator.of(context).pop();
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
//NFCNotSupported
|
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).NFCNotSupported);
|
|
|
|
|
}
|
|
|
|
|
}),
|
|
|
|
|
attendanceMethod(TranslationBase.of(context).pharmaLiveCareScanQR, "assets/images/new/services/qr_code.svg", true, () async {
|
|
|
|
|
String onlineCheckInQRCode = (await BarcodeScanner.scan().then((value) => value.rawContent));
|
|
|
|
|
if (onlineCheckInQRCode != "") {
|
|
|
|
|
print(onlineCheckInQRCode);
|
|
|
|
|
// getProjectIDFromNFC(onlineCheckInQRCode, true);
|
|
|
|
|
// sendNfcCheckInRequest(onlineCheckInQRCode, 2);
|
|
|
|
|
} else {}
|
|
|
|
|
}),
|
|
|
|
|
attendanceMethod(TranslationBase.of(context).checkInViaLocation, "assets/images/new/services/location.svg", true, () {})
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
));
|
|
|
|
|
|
|
|
|
|
// Navigator.push(context, FadePage(page: QRCode(patientShareResponse: patientShareResponse, appoQR: appoQR, appointment: appintment, isAncillaryOrderCheckIn: isAncillaryOrderCheckIn)))
|
|
|
|
|
// .then((value) {
|
|
|
|
|
// if (isAncillaryOrderCheckIn) {
|
|
|
|
|
// Utils.showErrorToast("isAncillaryOrderCheckIn");
|
|
|
|
|
// } else {
|
|
|
|
|
// getPatientAppointmentHistory();
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
startLocationCheckIn() async {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
|
|
|
|
|
locationUtils.getCurrentLocation(callBack: (value) {
|
|
|
|
|
projectDetailListModel = Utils.getProjectDetailObj(projectViewModel, widget.appointment!.projectID);
|
|
|
|
|
double dist = Utils.distance(value.latitude, value.longitude, double.parse(projectDetailListModel.latitude!), double.parse(projectDetailListModel.longitude!)).ceilToDouble() * 1000;
|
|
|
|
|
print(dist);
|
|
|
|
|
if (dist <= projectDetailListModel.geofenceRadius!) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
// sendNfcCheckInRequest(projectDetailListModel.checkInQrCode!, 2);
|
|
|
|
|
} else {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppToast.showErrorToast(message: TranslationBase.of(context).locationCheckInError);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -1595,6 +1698,29 @@ class _ToDoState extends State<ToDo> with SingleTickerProviderStateMixin {
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Widget attendanceMethod(String title, String image, bool isEnabled, VoidCallback onPress) => InkWell(
|
|
|
|
|
onTap: () {
|
|
|
|
|
Navigator.pop(context);
|
|
|
|
|
onPress();
|
|
|
|
|
},
|
|
|
|
|
child: Container(
|
|
|
|
|
decoration: containerColorRadiusBorderWidth(Colors.white, 15, CustomColors.darkGreyColor, 1),
|
|
|
|
|
clipBehavior: Clip.antiAlias,
|
|
|
|
|
padding: const EdgeInsets.only(left: 10, right: 10, top: 14, bottom: 14),
|
|
|
|
|
child: Column(
|
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
|
children: [
|
|
|
|
|
Expanded(child: SvgPicture.asset(image, color: Colors.black, alignment: Alignment.topLeft)),
|
|
|
|
|
Text(
|
|
|
|
|
title,
|
|
|
|
|
style: TextStyle(color: Colors.black, fontSize: 14, letterSpacing: -0.68, fontWeight: FontWeight.bold),
|
|
|
|
|
),
|
|
|
|
|
// title.toText17(isBold: true, color: Colors.white),
|
|
|
|
|
],
|
|
|
|
|
),
|
|
|
|
|
),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
ancillaryOrdersDetails(item, projectId) {
|
|
|
|
|
Navigator.push(
|
|
|
|
|
context,
|
|
|
|
|
|