|
|
|
|
@ -1,3 +1,5 @@
|
|
|
|
|
import 'dart:io';
|
|
|
|
|
|
|
|
|
|
import 'package:hmg_patient_app/core/enum/viewstate.dart';
|
|
|
|
|
import 'package:hmg_patient_app/core/model/prescriptions/Prescriptions.dart';
|
|
|
|
|
import 'package:hmg_patient_app/core/model/prescriptions/prescription_report.dart';
|
|
|
|
|
@ -25,6 +27,9 @@ import 'package:hmg_patient_app/widgets/show_zoom_image_dialog.dart';
|
|
|
|
|
import 'package:hmg_patient_app/widgets/transitions/fade_page.dart';
|
|
|
|
|
import 'package:flutter/cupertino.dart';
|
|
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
import 'package:http/http.dart' as http;
|
|
|
|
|
import 'package:open_filex/open_filex.dart';
|
|
|
|
|
import 'package:path_provider/path_provider.dart';
|
|
|
|
|
import 'package:provider/provider.dart';
|
|
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
|
|
|
|
|
|
|
|
|
@ -449,14 +454,17 @@ class PrescriptionItemsPage extends StatelessWidget {
|
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
|
await _prescriptionsService
|
|
|
|
|
.getMedicationsInstructionsPDF(setupID: prescriptions.setupID!, projectID: prescriptions.projectID!, appointmentNo: prescriptions.appointmentNo.toString())
|
|
|
|
|
.then((val) {
|
|
|
|
|
.then((val) async {
|
|
|
|
|
if (_prescriptionsService.hasError) {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
AppToast.showErrorToast(message: _prescriptionsService.error ?? "Unable to get PDF.");
|
|
|
|
|
} else {
|
|
|
|
|
GifLoaderDialogUtils.hideDialog(context);
|
|
|
|
|
print(_prescriptionsService.prescriptionInstructionsPDFLink);
|
|
|
|
|
launchUrl(Uri.parse(_prescriptionsService.prescriptionInstructionsPDFLink));
|
|
|
|
|
|
|
|
|
|
launchUrl(Uri.parse(_prescriptionsService.prescriptionInstructionsPDFLink), mode: LaunchMode.externalApplication);
|
|
|
|
|
// launchUrl(Uri.parse(_prescriptionsService.prescriptionInstructionsPDFLink));
|
|
|
|
|
// OpenFilex.open(_prescriptionsService.prescriptionInstructionsPDFLink);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
|