fluttertpc_file_preview:基于 Flutter 的文件预览插件项目

基于 file_preview 的 OpenHarmony 适配版,文件预览插件

分支1Tags4
文件最后提交记录最后更新时间
3 个月前
3 年前
2 年前
2 年前
4 年前
3 年前
3 年前
30 天前
4 年前
4 年前
4 年前
30 天前
2 年前
4 年前
1 年前
30 天前
30 天前
2 年前
4 年前
2 年前
2 年前

file_preview

本项目基于 file_preview 开发。

1. 安装与使用

1.1 安装方式

进入到工程目录并在 pubspec.yaml 中添加以下依赖:

pubspec.yaml

...

dependencies:
  file_preview:
    git:
      url: https://gitcode.com/CPF-Flutter/fluttertpc_file_preview.git
      path: ohos
      # ref: 1.2.0-ohos-1.0.1
      ref: x.x.x-ohos-x.x.x # 请根据下方TAG版本对应表选择TAG 
...

执行命令

flutter pub get

TAG 版本对应表

Flutter 框架版本 TAG 分支
3.7 1.2.0-ohos-1.0.1 master
3.22 - -
3.27 1.2.0-ohos-1.0.1 master
3.35 1.2.0-ohos-1.0.1 master

1.2 使用案例

使用案例详见 ohos/example

2. 约束与限制

2.1 兼容性

在以下版本中已测试通过

  1. Flutter: 3.7.12-ohos-1.1.3; SDK: 5.0.0(12); IDE: DevEco Studio: 5.1.0.828; ROM: 5.1.0.130 SP8;
  2. Flutter: 3.27.5-ohos-0.0.1; SDK: 5.0.0(12); IDE: DevEco Studio: 5.1.0.828; ROM: 5.1.0.130 SP8;
  3. Flutter: 3.35.7-ohos-0.0.1; SDK: 6.0.1(21); IDE: DevEco Studio: 6.0.1.260; ROM: 6.0.0.120 SP6;

3. API

"ohos Support"列为 yes 表示 ohos 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。

Name Description Type Input Output ohos Support
initTBS TBS初始化 function required String license Future no
tbsHasInit 判断TBS是否已经初始化 function / Future no
deleteCache 删除本地缓存 function / Future no
tbsVersion 获取TBS版本 function / Future no
showFile 切换文件 function String path void yes

4. 属性

"ohos Support"列为 yes 表示 ohos 平台支持该属性;no 则表示不支持;partially 表示部分支持。使用方法跨平台一致,效果对标 iOS 或 Android 的效果。

Parameters

Name Description Type ohos Support
path 文件地址 https/http开头、文件格式结尾的地址,或者本地绝对路径 String yes

5. 遗留问题

6. 其它

7. 开源协议

本项目基于 Apache-2.0 ,请自由地享受和参与开源。

项目介绍

基于 file_preview 的 OpenHarmony 适配版,文件预览插件

定制我的领域