packages.flutter icon indicating copy to clipboard operation
packages.flutter copied to clipboard

[2.8.0 pdfx] Flickering/Flashing of PDF Viewer on Page Load

Open LouisHeinrichAS opened this issue 1 year ago • 2 comments

Describe the bug When using the PdfViewPinch widget to display a PDF document (using Uint8List), there is a noticeable flickering or flashing effect when scrolling through the document. This occurs even after the page is fully loaded, causing a disruptive user experience when displaying on the web.

To Reproduce Load a PDF document using PdfViewPinch with a PdfControllerPinch to manage the document. Observe the behavior during the page load. The PDF viewer flickers or flashes when displayed on web.

FutureOr<Uint8List> data; // bodyBytes from http response

final pdfPinchController = PdfControllerPinch(
  document: PdfDocument.openData(data),
);

PdfViewPinch(
  controller: pdfPinchController,
  builders: PdfViewPinchBuilders<DefaultBuilderOptions>(
    options: const DefaultBuilderOptions(),
    documentLoaderBuilder: (_) => const Center(child: CircularProgressIndicator()),
    pageLoaderBuilder: (_) => const Center(child: CircularProgressIndicator()),
    errorBuilder: (_, error) {
      return const Center(child: Text(Strings.fileViewError));
    },
  ),
);

Expected behavior Once the page is fully loaded, it should remain stable without any flickering or flashing when scrolling through the document.

Screenshots N/A

Environment:

  • Device: GalaxyBook3 360
  • OS: Fedora Linux 40
  • Version: pdfx: ^2.8.0
  • Web App tested with GoogleChrome (129.0.6668.58)

LouisHeinrichAS avatar Sep 27 '24 10:09 LouisHeinrichAS

The same. It's a blocker for me. But the library doesn't seem to be supported.

ifuterman avatar Oct 06 '24 15:10 ifuterman

I'm also facing the same issue, Does anyone have a fix?

kashiflab avatar Nov 07 '24 10:11 kashiflab