PdfViewer.uri constructor
- Uri uri, {
- PdfPasswordProvider? passwordProvider,
- bool firstAttemptByEmptyPassword = true,
- Key? key,
- PdfViewerController? controller,
- PdfViewerParams params = const PdfViewerParams(),
- int initialPageNumber = 1,
- bool preferRangeAccess = false,
- Map<
String, String> ? headers, - bool withCredentials = false,
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.
withCredentials
is used to specify whether to include credentials in the request (Only supported on Web).
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,
bool withCredentials = false,
}) : documentRef = PdfDocumentRefUri(
uri,
passwordProvider: passwordProvider,
firstAttemptByEmptyPassword: firstAttemptByEmptyPassword,
preferRangeAccess: preferRangeAccess,
headers: headers,
withCredentials: withCredentials,
);