From 20ef0b593caffa1d44e7ce7ca5cb61f19444cb5c Mon Sep 17 00:00:00 2001 From: SurendarSuri30 Date: Mon, 1 Jun 2026 14:16:45 +0530 Subject: [PATCH] Ecard Download --- lib/presentation/hrPolicyDetails.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/presentation/hrPolicyDetails.dart b/lib/presentation/hrPolicyDetails.dart index 3044072..813cb75 100755 --- a/lib/presentation/hrPolicyDetails.dart +++ b/lib/presentation/hrPolicyDetails.dart @@ -446,12 +446,12 @@ class _HrPolicyDetailsState extends State Future _launchURL(String url) async { final Uri uri = Uri.parse(url); // Parse the URL properly logDebug('_launchURL $uri'); - if (uri != null) { - logDebug('If $uri'); - await launchUrl(uri, mode: LaunchMode.externalApplication); + logDebug('If $uri'); + if (kIsWeb) { + // Open in current browser tab on web. + await launchUrl(uri, webOnlyWindowName: '_self'); } else { - logDebug('else $uri'); - throw 'Could not launch $url'; + await launchUrl(uri, mode: LaunchMode.externalApplication); } }