docs: WEB BUILD SUCCEEDS. build_web.sh helper, TODO status update. lib 6 (util_io deferred), web 0 errors
This commit is contained in:
18
TODO.md
18
TODO.md
@@ -1,7 +1,12 @@
|
|||||||
# TODO — Flutter Wisetronic Dart 3 空安全迁移(剩余工作)
|
# TODO — Flutter Wisetronic Dart 3 空安全迁移
|
||||||
|
|
||||||
> **当前进度**:错误从峰值 **2374** 降到 **118(lib)/ 112(web 构建)**,0 语法损坏。
|
> ## ✅ Web 构建已成功!(2026-08-01)
|
||||||
> 分支 `dev2`,最新提交已 clean。Web 构建 (`flutter build web`) 目标:0 error → 可运行。
|
> **`flutter build web --no-tree-shake-icons` → ✓ Built build/web/(main.dart.js 4.5M)**
|
||||||
|
> - `dart analyze lib`: 仅剩 **6 error**,全部在 `utils/util_io.dart`(原生路径,Web 已排除,见 §5 延后)。
|
||||||
|
> - Web 可达错误: **0**。
|
||||||
|
> - 峰值 2374 → 6(全部 util_io 原生)。0 语法损坏。分支 `dev2`。
|
||||||
|
> - 构建脚本: `./build_web.sh`(构建)/ `./build_web.sh run`(Chrome 运行)。
|
||||||
|
> - **关键修复**: `cross_file` override 到 `0.3.4+2`(旧版 0.3.1+4 用了 Dart3 移除的 `UnmodifiableUint8ListView`;0.3.5+ 需 Dart 3.10)。
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -10,10 +15,11 @@
|
|||||||
```bash
|
```bash
|
||||||
cd /Users/peima/StudioProjects/flutter_wisetronic
|
cd /Users/peima/StudioProjects/flutter_wisetronic
|
||||||
git log --oneline -1 # 确认在最新提交
|
git log --oneline -1 # 确认在最新提交
|
||||||
dart analyze lib | tail -5 # 看当前错误(应 118 error)
|
dart analyze lib | tail -5 # 当前: 仅 6 error(util_io.dart)
|
||||||
flutter build web 2>&1 | grep -c '^Error:' # web 错误(应 112)
|
./build_web.sh # 构建: ✓ Built build/web/
|
||||||
|
./build_web.sh run # Chrome 运行调试
|
||||||
|
|
||||||
# 重跑自动修复脚本(安全,带损坏自检,可随时跑)
|
# 重跑自动修复脚本(安全,带损坏自检,可随时跑)—— 已无 web 可达错误,通常无需再跑
|
||||||
python3 tools/nullfix.py --max-rounds 12
|
python3 tools/nullfix.py --max-rounds 12
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
24
build_web.sh
Executable file
24
build_web.sh
Executable file
@@ -0,0 +1,24 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
# Flutter Wisetronic — Web 构建脚本
|
||||||
|
# 用法:
|
||||||
|
# ./build_web.sh # 构建 release 版本到 build/web/
|
||||||
|
# ./build_web.sh run # 构建并在 Chrome 中运行调试版
|
||||||
|
#
|
||||||
|
# 说明:
|
||||||
|
# - 必须 --no-tree-shake-icons: 项目中有 24 处 IconData(codePoint) 使用
|
||||||
|
# 来自 JSON/API 的动态 code point(非 const), icon tree-shaking 无法处理。
|
||||||
|
# - Dart SDK: 本地 Flutter 3.29.3 / Dart 3.7.2(未升级全局 SDK)。
|
||||||
|
set -e
|
||||||
|
cd "$(dirname "$0")"
|
||||||
|
|
||||||
|
if [ "$1" = "run" ]; then
|
||||||
|
echo ">>> flutter run -d chrome --no-tree-shake-icons"
|
||||||
|
flutter run -d chrome --no-tree-shake-icons
|
||||||
|
else
|
||||||
|
echo ">>> flutter build web --no-tree-shake-icons"
|
||||||
|
flutter build web --no-tree-shake-icons
|
||||||
|
echo ""
|
||||||
|
echo "✓ 构建完成: build/web/ (main.dart.js: $(du -h build/web/main.dart.js | cut -f1))"
|
||||||
|
echo " 本地预览: python3 -m http.server --directory build/web 8080"
|
||||||
|
echo " 然后访问 http://localhost:8080/"
|
||||||
|
fi
|
||||||
Reference in New Issue
Block a user