flutter_pdfview icon indicating copy to clipboard operation
flutter_pdfview copied to clipboard

PDF is not visible in API Level 31 (Android 12) version.

Open shinxxxxwon opened this issue 2 years ago • 1 comments

Thank you for your package.
We are developing an app that creates and displays pdfs directly with the pdf package. When this app is run, it creates a 'pdf' by default.
When the app runs, the default 'pdf' is shown on the screen, but it is not shown in the android 12 version.
I am using version 1.2.2 of flutter_pdfview. Looking at the change log, I saw that I updated compileSdkVersion to 30.
However, if the user changes the settings of pdf, the pdf is created again, updated, and displayed on the screen. However, the pdf is updated only in debug mode and in release mode, the pdf is updated only when there is an action such as changing the page.

Is there a way to show pdf initially in android 12 version and also update pdfView if you update pdfData in release mode?? I am attaching the code below.

PDFView(
            key: ValueKey(context.read<PDFProvider>().keyCount),
            pdfData: context.watch<PDFProvider>().uinPdfData!,
            enableSwipe: true,
            swipeHorizontal: true,
            autoSpacing: false,
            pageFling: false,
            defaultPage: 0,
            onRender: (_pages) {
              setState(() {
                isReady = true;
              });
            },
            onError: (error) {
              print(error.toString());
            },
            onPageError: (page, error) {
              print('$page: ${error.toString()}');
            },
            onPageChanged: (int? page, int? total) {
              setState(() {
                nPageIndex = page! + 1;
                context.read<PDFProvider>().setTotalStffNum(total!);
              });
            },
          ),

Thanks for your help.

shinxxxxwon avatar Dec 27 '22 07:12 shinxxxxwon

Fixed the problem that the initial 'pdf' is not displayed in the 'android 12' version. It was a problem with sync. But still pdf doesn't change in release.

shinxxxxwon avatar Dec 27 '22 07:12 shinxxxxwon