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:fl_downloader/fl_downloader.dart';
import 'package:flutter_speed_dial/flutter_speed_dial.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/main.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_package_components/mih_icons.dart';
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart'; import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
@@ -125,13 +126,21 @@ class _BuildClaimStatementFileListState
void printDocument(String link, String path) async { void printDocument(String link, String path) async {
http2.Response response = await http.get(Uri.parse(link)); http2.Response response = await http.get(Uri.parse(link));
var pdfData = response.bodyBytes; var pdfData = response.bodyBytes;
Navigator.of(context).pushNamed( context.pop();
'/file-veiwer/print-preview', context.pushNamed(
arguments: PrintPreviewArguments( 'printPreview',
extra: PrintPreviewArguments(
pdfData, pdfData,
getFileName(path), getFileName(path),
), ),
); );
// Navigator.of(context).pushNamed(
// '/file-veiwer/print-preview',
// arguments: PrintPreviewArguments(
// pdfData,
// getFileName(path),
// ),
// );
} }
void nativeFileDownload(String fileLink) async { void nativeFileDownload(String fileLink) async {
@@ -222,7 +231,15 @@ class _BuildClaimStatementFileListState
backgroundColor: MihColors.getGreenColor( backgroundColor: MihColors.getGreenColor(
MzansiInnovationHub.of(context)!.theme.mode == "Dark"), MzansiInnovationHub.of(context)!.theme.mode == "Dark"),
onTap: () { 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 Loading Dialog
context.pop(); //Remove Delete Dialog context.pop(); //Remove Delete Dialog
context.pop(); //Remove File View Dialog context.pop(); //Remove File View Dialog
Navigator.of(context).pop(); //Remove File List Dialog context.pop(); //Remove File List Dialog
//print(widget.business); //print(widget.business);
if (widget.business == null) { if (widget.business == null) {
context.pushNamed('patientManagerPatient', context.pushNamed('patientManagerPatient',

View File

@@ -1,5 +1,6 @@
import 'dart:convert'; 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_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/arguments.dart';
import 'package:mzansi_innovation_hub/mih_components/mih_objects/claim_statement_file.dart'; import 'package:mzansi_innovation_hub/mih_components/mih_objects/claim_statement_file.dart';
@@ -89,12 +90,13 @@ class MIHClaimStatementGenerationApi {
}), }),
); );
if (response2.statusCode == 201) { if (response2.statusCode == 201) {
// end loading circle context.pop(); // end loading circle
Navigator.of(context).pop(); context.pop();
Navigator.of(context).pop();
Navigator.of(context).pop(); context.pushNamed(
Navigator.of(context) 'patientManagerPatient',
.pushNamed('/patient-manager/patient', arguments: args); extra: args,
);
String message = 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."; "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); successPopUp(message, context);
@@ -215,14 +217,13 @@ class MIHClaimStatementGenerationApi {
<String, dynamic>{"idclaim_statement_file": fileID, "env": env}), <String, dynamic>{"idclaim_statement_file": fileID, "env": env}),
); );
if (response2.statusCode == 200) { if (response2.statusCode == 200) {
Navigator.of(context).pop(); context.pop();
Navigator.of(context).pop(); context.pop();
Navigator.of(context).pop(); context.pop();
Navigator.of(context).pop(); context.pop();
//print(widget.business); //print(widget.business);
Navigator.of(context) context.pushNamed('patientManagerPatient', extra: args);
.pushNamed('/patient-manager/patient', arguments: args);
// Navigator.of(context) // Navigator.of(context)
// .pushNamed('/patient-profile', arguments: widget.signedInUser); // .pushNamed('/patient-profile', arguments: widget.signedInUser);