flutter_cached_pdfview
0.4.4, released 5 months ago by bnsaed.com
Display native PDF views on Android and iOS from a path, asset, or cached URL.
What it does
Provides widgets to render native PDF views from various resources like local paths, asset bundles, or network URLs with built-in caching. Supports features such as zooming, swiping horizontally or vertically, jumping to specific pages, and password protection.
AI-written summary of version 0.4.4, based on the package's README and metadata. Report an inaccuracy
Use it when
- You need to display PDF documents directly inside your Flutter UI on Android and iOS.
- You need to load and cache remote PDFs from URLs automatically.
Skip it when
- You need robust web support (currently listed as 'soon' in the documentation).
- You need advanced custom PDF rendering and manipulation logic in pure Dart rather than native platform views.
Strengths
- Supports loading from local paths, assets, and remote URLs with caching.
- Native rendering performance using AndroidPdfViewer and PDFKit.
- Customizable options for page swiping, zooming, night mode, and event callbacks.
Weaknesses
- Requires native configuration steps (like modifying Info.plist and Podfile on iOS).
- Web support is not yet fully implemented.
- Some options have platform-specific limitations (e.g., nightMode and pageSnap are Android-only).
Setup
- Kind
- Flutter widgets
- Effort
- Medium
- Code generation
- No
- Direct dependencies
- 4
Requires adding 'io.flutter.embedded_views_preview' to Info.plist and setting platform to at least iOS 11.0 in the Podfile. For Android with Proguard, you need to keep com.shockwave classes.
PDF(
swipeHorizontal: true,
).cachedFromUrl('https://ontheline.trincoll.edu/images/bookdown/sample-local-pdf.pdf')Alternatives
Packages that do the same job and could replace flutter_cached_pdfview.
- file_saver
Save files from bytes, paths, streams, and URLs across Android, iOS, Web, Windows, macOS, and Linux.
87Compare - path_provider_android
Android implementation of the path_provider plugin for finding commonly used locations.
79Compare - path_provider_foundation
iOS/macOS implementation of path_provider using direct FFI calls
78Compare - alh_pdf_view
Show PDF files or bytes as a Flutter widget on Android and iOS.
64Compare
Works with
Packages commonly used together with flutter_cached_pdfview: ones it builds on, ones built on it, and its own family.
- path_providerflutter_cached_pdfview depends on itProvides Flutter APIs to locate common filesystem directories on Android, iOS, macOS, Linux and Windows.
- flutter_cache_managerflutter_cached_pdfview depends on itGeneric cache manager for saving web files and cache info on device storage.
- flutter_pdfviewflutter_cached_pdfview depends on itA Flutter plugin providing native PDFView widgets on Android and iOS.