Baseflow / Baseflow/flutter_cache_manager
getSingleFile() doesn't return fully downloaded file
- 主要语言
- Dart
- 星标
- 809
- 派生
- 510
- 平均合并
- 6 分钟
- 30 天内合并 PR
- 1
描述
```
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.7.8+hotfix.4, on Microsoft Windows [Version 10.0.17763.678], locale en-US)
[!] Android toolchain - develop for Android devices (Android SDK version 28.0.3)
X Android license status unknown.
Try re-installing or updating your Android SDK Manager.
See https://developer.android.com/studio/#downloads or visit https://flutter.dev/setup/#android-setup for detailed instructions.
[√] Android Studio (version 3.4)
[√] VS Code (version 1.37.0)
[√] Connected device (1 available)
```
For those that are attempting to use getSingleFile() before using video_player to play a downloaded video, even when doing an await on getSingleFile() the File is very often returned before the video is downloaded fully, which causes the video player to fail initialization.
No attempts at re-downloading or re-initilializing seemed to work, so dropped use of flutter_cache_manager and switched to downloading the file locally using dio package. This obviously negates the benefit of cache management, but it seemed to respect await properly by ensuring that the file returned is completely downloaded before returning.
贡献指南
调研方向
从 getSingleFile() 入口开始,使用 issue 中描述的 Flutter 和 Android 设置,通过 video_player 重现报告的行为。确认返回的 File 在 video_player 初始化之前已完全下载;无需将 flutter_cache_manager 替换为 dio 即可可靠地实现这一行为时,该 issue 即完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- dart, flutter
- 领域
- mobile
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100