file_preview_ohos 1.0.0 copy "file_preview_ohos: ^1.0.0" to clipboard
file_preview_ohos: ^1.0.0 copied to clipboard

A plug-in that supports flutter preview files.

file_preview_ohos #

文本预览插件。

file_preview 在 OpenHarmony 平台的实现。

Usage #

dependencies:
  file_preview: 1.2.0
  file_preview_ohos: 1.0.0

Example: #

import 'package:file_preview_ohos/file_preview.dart';

//文件控制器
FilePreviewController controller = FilePreviewController();

//切换文件
//path 文件地址 https/http开头、文件格式结尾的地址,或者本地绝对路径
controller.showFile(path);

//文件预览widget
FilePreviewWidget(
    controller: controller,
    width: 400,
    height: 600,
    //path 文件地址 https/http开头、文件格式结尾的地址,或者本地绝对路径
    path: widget.path,
    callBack: FilePreviewCallBack(onShow: () {
      print("文件打开成功");
    }, onDownload: (progress) {
      print("文件下载进度$progress");
    }, onFail: (code, msg) {
      print("文件打开失败 $code  $msg");
    }),
),

支持格式 #

格式 android ios harmonyOS
.doc
.docx
.ppt
.pptx
.xls
.xlsx
.pdf
.OFD
more TBS限制不可预览 WKWebView支持均可预览 本地预览仅支持txt和pdf
0
likes
60
points
15
downloads

Publisher

unverified uploader

Weekly Downloads

A plug-in that supports flutter preview files.

Homepage

Documentation

API reference

License

Apache-2.0 (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on file_preview_ohos

Packages that implement file_preview_ohos