This commit is contained in:
Developer
2026-04-25 01:18:50 +08:00
parent 7d5d95d5e0
commit 3c90407bb5
193 changed files with 32355 additions and 2284 deletions

View File

@@ -157,6 +157,7 @@ flutter pub get && flutter analyze --no-pub
| 7 | qr | 3.0.2 | 3.0.2-ohos.1 | 2026-04-19 | ✅ pub get 通过 |
| 8 | mailer | 7.1.0 | 7.1.0-ohos.1 | 2026-04-19 | ✅ pub get 通过 |
| 9 | mobile_scanner | 7.2.0 | 7.2.0+ohos | 2026-04-22 | ✅ 原生插件含鸿蒙ets实现 |
| 10 | docs_gee | 1.3.2 | 1.3.2-ohos.1 | 2026-04-24 | ✅ 纯DartDOCX/PDF生成库 |
### 5.2 各包克隆命令速查
@@ -191,6 +192,10 @@ git clone --depth 1 --branch v7.1.0 https://github.com/dart-mailer/mailer.git ma
# 9. mobile_scanner官方v7.2.0 + 鸿蒙适配合并)
git clone --depth 1 --branch v7.2.0 https://github.com/juliansteenbakker/mobile_scanner.git mobile_scanner
# 合并鸿蒙适配ohos/ 目录、ohos_surface_producer_delegate.dart、surface_producer_delegate.dart、rotated_preview.dart 鸿蒙旋转修复
# 10. docs_gee纯DartDOCX/PDF文档生成库
git clone --depth 1 https://github.com/erykkruk/docs_gee.git docs_gee
# 实际代码在 docx_generator/ 子目录,引用路径: packages/docs_gee/docx_generator
```
### 5.3 各包使用示例
@@ -258,6 +263,23 @@ MobileScanner(
)
```
**docs_gee**
```dart
import 'package:docs_gee/docs_gee.dart';
import 'dart:io';
final doc = Document(title: '报告', author: '作者');
doc.addParagraph(Paragraph.heading('标题', level: 1));
doc.addParagraph(Paragraph.text('正文内容'));
doc.addTable(Table(rows: [
TableRow(cells: [TableCell.text('列1'), TableCell.text('列2')]),
TableRow(cells: [TableCell.text('数据1'), TableCell.text('数据2')]),
]));
File('report.docx').writeAsBytesSync(DocxGenerator().generate(doc));
File('report.pdf').writeAsBytesSync(PdfGenerator().generate(doc));
```
---
## 六、项目依赖兼容性总览
@@ -273,6 +295,7 @@ MobileScanner(
| qr | 本地 path | ✅ | ✅ | 纯 DartQR码生成 |
| mailer | 本地 path | ❌ | ✅ | 纯 DartSMTP客户端Web不支持 |
| mobile_scanner | 本地 path | ✅ | ✅ | 原生插件,扫码/二维码v7.2.0+鸿蒙适配 |
| docs_gee | 本地 path | ⚠️ | ✅ | 纯DartDOCX/PDF生成Web需处理文件保存 |
| hive_ce | pub.dev | ✅ | ✅ | 纯 Dart |
| get / dio / logger / intl | pub.dev | ✅ | ✅ | 纯 Dart |
| shared_preferences | pub.dev | ✅ | ✅ | localStorage |