PdfViewer.uri constructor

PdfViewer.uri(
  1. Uri uri, {
  2. PdfPasswordProvider? passwordProvider,
  3. bool firstAttemptByEmptyPassword = true,
  4. Key? key,
  5. PdfViewerController? controller,
  6. PdfViewerParams params = const PdfViewerParams(),
  7. int initialPageNumber = 1,
  8. bool preferRangeAccess = false,
  9. Map<String, String>? headers,
})

Create PdfViewer from a URI.

uri is the URI. 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. preferRangeAccess to prefer range access to download the PDF. The default is false. headers is used to specify additional HTTP headers especially for authentication/authorization.

Implementation

PdfViewer.uri(
  Uri uri, {
  PdfPasswordProvider? passwordProvider,
  bool firstAttemptByEmptyPassword = true,
  super.key,
  this.controller,
  this.params = const PdfViewerParams(),
  this.initialPageNumber = 1,
  bool preferRangeAccess = false,
  Map<String, String>? headers,
}) : documentRef = PdfDocumentRefUri(
        uri,
        passwordProvider: passwordProvider,
        firstAttemptByEmptyPassword: firstAttemptByEmptyPassword,
        preferRangeAccess: preferRangeAccess,
        headers: headers,
      );