PdfViewer.file constructor

PdfViewer.file(
  1. String path, {
  2. PdfPasswordProvider? passwordProvider,
  3. bool firstAttemptByEmptyPassword = true,
  4. Key? key,
  5. PdfViewerController? controller,
  6. PdfViewerParams params = const PdfViewerParams(),
  7. int initialPageNumber = 1,
})

Create PdfViewer from a file.

path is the file path. passwordProvider is used to provide password for encrypted PDF. See PdfPasswordProvider for more info. firstAttemptByEmptyPassword is used to determine whether the first attempt to open the PDF is by empty password or not. For more info, see PdfPasswordProvider. controller is the controller to control the viewer. params is the parameters to customize the viewer. initialPageNumber is the page number to show initially.

Implementation

PdfViewer.file(
  String path, {
  PdfPasswordProvider? passwordProvider,
  bool firstAttemptByEmptyPassword = true,
  super.key,
  this.controller,
  this.params = const PdfViewerParams(),
  this.initialPageNumber = 1,
}) : documentRef = PdfDocumentRefFile(
        path,
        passwordProvider: passwordProvider,
        firstAttemptByEmptyPassword: firstAttemptByEmptyPassword,
      );