问题根因: SelfHostedUpdater._listenToProgress() 在 initState 和 _startDownload 中 订阅 UpdateService.downloadProgressStream,但该 getter 返回 _downloadManager?.progressStream —— _downloadManager 在 downloadUpdate() 调用前为 null,?.listen 无操作。downloadUpdate() 创建新 _downloadManager 后,其 progressStream 无人监听,进度事件全部丢失,UI 无任何反馈。 修复: 1. UpdateService 新增持久化广播流 _downloadProgressController, downloadUpdate() 创建新 DownloadManager 后将其进度转发到此流 2. downloadProgressStream getter 改为返回持久化流(非 nullable) 3. SelfHostedUpdater 在 initState 中一次性订阅持久化流, dispose 时取消订阅,_startDownload 不再重复订阅 Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| android | ||
| assets | ||
| ios | ||
| lib | ||
| scripts | ||
| test | ||
| .gitignore | ||
| .metadata | ||
| DEVELOPMENT_GUIDE.md | ||
| README.md | ||
| analysis_options.yaml | ||
| pubspec.yaml | ||
README.md
mining_app
A new Flutter project.
Getting Started
This project is a starting point for a Flutter application.
A few resources to get you started if this is your first Flutter project:
For help getting started with Flutter development, view the online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.