diff --git a/lib/screens/reports/report_pdf_export.dart b/lib/screens/reports/report_pdf_export.dart index b09d0a2d..d646e4da 100644 --- a/lib/screens/reports/report_pdf_export.dart +++ b/lib/screens/reports/report_pdf_export.dart @@ -1,4 +1,3 @@ -import 'dart:isolate'; import 'dart:typed_data'; import 'dart:ui' as ui; @@ -72,22 +71,19 @@ class ReportPdfExport { final generated = AppTime.formatDate(AppTime.now()); final dateLabel = dateRange.label; - // ── Build the PDF on a background isolate so it doesn't freeze the UI ── - return Isolate.run(() { - return _buildPdfBytes( - chartImages: chartImages, - dateRangeText: dateRangeText, - dateLabel: dateLabel, - generated: generated, - regularFontData: regularFontData.buffer.asUint8List(), - boldFontData: boldFontData.buffer.asUint8List(), - logoBytes: logoBytes, - ); - }); + // ── Build the PDF on the main thread (dart:isolate is not supported on web) ── + return _buildPdfBytes( + chartImages: chartImages, + dateRangeText: dateRangeText, + dateLabel: dateLabel, + generated: generated, + regularFontData: regularFontData.buffer.asUint8List(), + boldFontData: boldFontData.buffer.asUint8List(), + logoBytes: logoBytes, + ); } /// Pure function that assembles the PDF document from raw data. - /// Designed to run inside [Isolate.run]. static Future _buildPdfBytes({ required Map chartImages, required String dateRangeText,