fix claims view print and delete

This commit is contained in:
2025-09-12 09:36:24 +02:00
parent 179fe738f9
commit aa18c7b3a6
3 changed files with 35 additions and 17 deletions

View File

@@ -2,6 +2,7 @@ import 'dart:async';
import 'package:fl_downloader/fl_downloader.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.dart';
import 'package:go_router/go_router.dart';
import 'package:mzansi_innovation_hub/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
@@ -125,13 +126,21 @@ class _BuildClaimStatementFileListState
void printDocument(String link, String path) async {
http2.Response response = await http.get(Uri.parse(link));
var pdfData = response.bodyBytes;
Navigator.of(context).pushNamed(
'/file-veiwer/print-preview',
arguments: PrintPreviewArguments(
context.pop();
context.pushNamed(
'printPreview',
extra: PrintPreviewArguments(
pdfData,
getFileName(path),
),
);
// Navigator.of(context).pushNamed(
// '/file-veiwer/print-preview',
// arguments: PrintPreviewArguments(
// pdfData,
// getFileName(path),
// ),
// );
}
void nativeFileDownload(String fileLink) async {
@@ -222,7 +231,15 @@ class _BuildClaimStatementFileListState
backgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
onTap: () {
printDocument(url, filePath);
context.pop();
context.pushNamed(
'fileViewer',
extra: FileViewArguments(
url,
filePath,
),
);
// printDocument(url, filePath);
},
),
);

View File

@@ -107,7 +107,7 @@ class _BuildFilesListState extends State<BuildFilesList> {
context.pop(); //Remove Loading Dialog
context.pop(); //Remove Delete Dialog
context.pop(); //Remove File View Dialog
Navigator.of(context).pop(); //Remove File List Dialog
context.pop(); //Remove File List Dialog
//print(widget.business);
if (widget.business == null) {
context.pushNamed('patientManagerPatient',

View File

@@ -1,5 +1,6 @@
import 'dart:convert';
import 'package:go_router/go_router.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_objects/claim_statement_file.dart';
@@ -89,12 +90,13 @@ class MIHClaimStatementGenerationApi {
}),
);
if (response2.statusCode == 201) {
// end loading circle
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context)
.pushNamed('/patient-manager/patient', arguments: args);
context.pop(); // end loading circle
context.pop();
context.pushNamed(
'patientManagerPatient',
extra: args,
);
String message =
"The ${data.document_type}: $fileName has been successfully generated and added to ${data.patient_full_name}'s record. You can now access and download it for their use.";
successPopUp(message, context);
@@ -215,14 +217,13 @@ class MIHClaimStatementGenerationApi {
<String, dynamic>{"idclaim_statement_file": fileID, "env": env}),
);
if (response2.statusCode == 200) {
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pop();
context.pop();
context.pop();
context.pop();
context.pop();
//print(widget.business);
Navigator.of(context)
.pushNamed('/patient-manager/patient', arguments: args);
context.pushNamed('patientManagerPatient', extra: args);
// Navigator.of(context)
// .pushNamed('/patient-profile', arguments: widget.signedInUser);