A powerful file view widget, support a variety of file types, such as Doc Eexcl PPT TXT PDF and so on, Android is implemented by Tencent X5, iOS is implemented by WKWebView.
Package selection guidance compiled from public package information, community data, and project usage.
PowerFileView is a Flutter widget that enables seamless viewing of multiple file types, including DOC, XLS, PPT, TXT, and PDF. On Android, it leverages Tencent X5 for rendering, while on iOS, it uses WKWebView. The package simplifies integration of file previews within Flutter apps, offering reliable cross-platform support with minimal setup. It's ideal for applications requiring document browsing without external app dependencies.
Use cases
Document preview in mobile apps
Internal file viewer for educational platforms
Business app document sharing
PDF and office file display
Offline document access
Key features
Supports multiple file formats
Uses native web engines (X5 & WKWebView)
Cross-platform compatibility
Easy integration with Flutter
Lightweight and fast rendering
Suitable for
Educational apps
Enterprise document management
Content delivery platforms
Mobile productivity tools
Apps with file-sharing features
Considerations
Requires internet for some online content
Limited customization of web view appearance
May need additional permissions for file access
Depends on external web engine performance
Not suitable for complex interactive documents
Original README
Original README snapshot from the linked source repository. Visit the repository for the latest content.
ios uses WKWebView, all supported by WKWebView can be previewed
Supported formats
Format
android
ios
.doc
✅
✅
.docx
✅
✅
.ppt
✅
✅
.pptx
✅
✅
.xls
✅
✅
.xlsx
✅
✅
.pdf
✅
✅
Integration
1. Dependency
Add under the pubspec.yaml file:
power_file_view: ^1.0.0
2. Quick integration
1. Android
Since using android to use TBS service, network permission and storage permission are required.
Add the following permissions to the AndroidManifest file of Android.
In order to prevent the release version from failing to load the TBS kernel library.
Add the following code to the obfuscation file proguard-rules.pro.
Since android uses the TBS service, it needs to be initialized before use, which takes about 3-30 seconds.
Asynchronous initialization (recommended)
Asynchronous initialization can be performed under the main function of the app's main.dart file, so that the user does not need to wait for TBS initialization when opening the file.
If the asynchronous initialization configuration is not performed, the initialization operation will be performed automatically before the file is opened, and the user does not need to configure
4. Quick use
file preview
Network files: Just pass in the downloadUrl of the file to be previewed and the downloadPath of the storage path of the file to download.
define downloadPath
import 'package:path_provider/path_provider.dart';
...
final _directory = await getTemporaryDirectory();
final downloadPath = "${_directory.path}/fileview/"fileName.pdf";//Set a name you like
Local file: Just pass in the downloadPath of the path where the local file is located.