|
|
|
@ -25,9 +25,10 @@ import 'package:provider/provider.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class PrescriptionDetailPage extends StatefulWidget {
|
|
|
|
class PrescriptionDetailPage extends StatefulWidget {
|
|
|
|
PrescriptionDetailPage({super.key, required this.prescriptionsResponseModel});
|
|
|
|
PrescriptionDetailPage({super.key, required this.prescriptionsResponseModel, required this.isFromAppointments});
|
|
|
|
|
|
|
|
|
|
|
|
PatientPrescriptionsResponseModel prescriptionsResponseModel;
|
|
|
|
PatientPrescriptionsResponseModel prescriptionsResponseModel;
|
|
|
|
|
|
|
|
bool isFromAppointments = false;
|
|
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
@override
|
|
|
|
State<PrescriptionDetailPage> createState() => _PrescriptionDetailPageState();
|
|
|
|
State<PrescriptionDetailPage> createState() => _PrescriptionDetailPageState();
|
|
|
|
@ -43,10 +44,12 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
|
|
|
|
checkAndRemove(false);
|
|
|
|
checkAndRemove(false);
|
|
|
|
// locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
|
|
|
|
// locationUtils = new LocationUtils(isShowConfirmDialog: true, context: context);
|
|
|
|
// WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
|
|
|
|
// WidgetsBinding.instance.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
|
|
|
|
scheduleMicrotask(() {
|
|
|
|
if (!widget.isFromAppointments) {
|
|
|
|
prescriptionsViewModel.setPrescriptionsDetailsLoading();
|
|
|
|
scheduleMicrotask(() {
|
|
|
|
prescriptionsViewModel.getPrescriptionDetails(widget.prescriptionsResponseModel);
|
|
|
|
prescriptionsViewModel.setPrescriptionsDetailsLoading();
|
|
|
|
});
|
|
|
|
prescriptionsViewModel.getPrescriptionDetails(widget.prescriptionsResponseModel);
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
super.initState();
|
|
|
|
super.initState();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ -146,7 +149,7 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
|
|
|
|
CustomButton(
|
|
|
|
CustomButton(
|
|
|
|
text: "Download Prescription".needTranslation,
|
|
|
|
text: "Download Prescription".needTranslation,
|
|
|
|
onPressed: () async {
|
|
|
|
onPressed: () async {
|
|
|
|
LoaderBottomSheet.showLoader();
|
|
|
|
LoaderBottomSheet.showLoader(loadingText: "Fetching prescription PDF, Please wait...".needTranslation);
|
|
|
|
await prescriptionVM.getPrescriptionPDFBase64(widget.prescriptionsResponseModel).then((val) async {
|
|
|
|
await prescriptionVM.getPrescriptionPDFBase64(widget.prescriptionsResponseModel).then((val) async {
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
LoaderBottomSheet.hideLoader();
|
|
|
|
if (prescriptionVM.prescriptionPDFBase64Data.isNotEmpty) {
|
|
|
|
if (prescriptionVM.prescriptionPDFBase64Data.isNotEmpty) {
|
|
|
|
@ -181,8 +184,10 @@ class _PrescriptionDetailPageState extends State<PrescriptionDetailPage> {
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
).paddingSymmetrical(24.h, 0.h),
|
|
|
|
|
|
|
|
SizedBox(height: 16.h),
|
|
|
|
ListView.builder(
|
|
|
|
ListView.builder(
|
|
|
|
shrinkWrap: true,
|
|
|
|
shrinkWrap: true,
|
|
|
|
|
|
|
|
padding: EdgeInsets.zero,
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
physics: NeverScrollableScrollPhysics(),
|
|
|
|
itemCount: prescriptionVM.isPrescriptionsDetailsLoading ? 5 : prescriptionVM.prescriptionDetailsList.length,
|
|
|
|
itemCount: prescriptionVM.isPrescriptionsDetailsLoading ? 5 : prescriptionVM.prescriptionDetailsList.length,
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
itemBuilder: (context, index) {
|
|
|
|
|