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

[native_pdf_view] How to get last page read of pdf save with sharedpreferences ?

Open aminsamad opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe. A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like A clear and concise description of what you want to happen.

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

aminsamad avatar Jul 14 '21 16:07 aminsamad

 onPageChanged: (int page) {
        _lastPage = page;
      // save on SharedPreferences
}

// load _lastPage on initState and then setState whit the pdfController.

 _pdfController = PdfController(
        document: PdfDocument.openFile(filePathOnRam),
        initialPage: _bookmarkPosition ?? 0,
      );

lcyper avatar Dec 28 '21 17:12 lcyper