codifyiq_pdf_viewer 2.0.0
codifyiq_pdf_viewer: ^2.0.0 copied to clipboard
A PDF viewer with zoom controls, a page indicator, and optional text search, inline or as a full-screen route, powered by pdfrx.
2.0.0 #
- Breaking: now built on
material_ui, Flutter's standalone Material library, instead of the copy bundled in the Flutter SDK. Your app must usematerial_uitoo, otherwise the widgets won't pick up your theme. To migrate your app, rundart fix --apply --code=migrate_design_widgets. - Breaking: requires Flutter 3.44 / Dart 3.12 or later.
- Breaking: requires
pdfrx2.5.0 or later, the first release built onmaterial_ui, so the viewer's built-in controls follow your app's theme. PdfViewerScreen— a full-screen PDF viewer to push as its own route, for example from a tapped chat attachment. It has a close button, an optional title (such as the file name), and a search button that shows the search bar ready to type in. The system back gesture closes the search bar before the screen. The close button is hidden when there is nowhere to go back to; passonClosewhen the screen isn't a pushed route, such as a deep-linked page.- Supply
onShareandonDownloadto enable Share and Download, and add your own overflow menu entries withPdfViewerAction. Share is an app bar button on mobile and desktop and Download on web, with the other in the overflow menu, matchingcodifyiq_image_viewer. Share hands back the button's position for the iPad share sheet. PdfViewerWidgetgainsautofocusSearch(defaultfalse) to focus the search field as soon as the search bar appears, or as soon as the document is ready if the bar appears while it is still loading.
1.1.0 #
PdfSource.urigains apreferRangeAccessflag (defaultfalse). When enabled, the viewer streams a network PDF via HTTP range requests instead of downloading it in full first, so the first page of a large document renders after a single small request. Servers that don't support range requests fall back to a full download automatically. No effect on web.PdfViewerWidgetnow shows a linear download progress bar across the top of the viewer while a network PDF loads — determinate when the server reports a content length, indeterminate otherwise. Disable it withshowDownloadProgress: false, and/or passonDownloadProgress: (received, total) { ... }to drive your own progress UI.PdfSource.urigains auseProgressiveLoadingflag (defaulttrue) that hands back pages as the document parses instead of only after the whole file is available. Combined withpreferRangeAccess: trueand a linearized ("Fast Web View") PDF, later pages of a large remote document can render before the download finishes; non-linearized PDFs still need a near-complete download first.PdfViewerWidgetgains aninitialPageNumber(default1) to open a document to a specific page — handy for deep links or resuming where the reader left off. Applies to all source types.PdfViewerWidgetgains anetworkTimeout(default 30 seconds) forPdfSource.uri: if a network request fails to start responding within the window it surfaces the error UI instead of waiting forever. It bounds the response start (connect + headers) per request, not the total download time.
1.0.0 #
- Initial release as a standalone package, extracted from
codifyiq_core_components. PdfViewerWidgetandPdfSource— a PDF viewer with a built-in search UI, consistent zoom bounds, web zoom buttons, a page indicator, and a unified network/file/bytes source.