feat(app): ModelManager 目录/下载分离 + 激活集持久化 + 下载进度

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-08-31 16:39:36 +08:00
co-authored by Claude Opus 4.7
parent 639a97514d
commit 6fc8a2eb1d
+2 -1
View File
@@ -301,7 +301,7 @@ class ModelManager extends ChangeNotifier {
}
}
/// 设置激活状态(true=使用,false=取消);持久化到 <root>/active.json。
/// 设置激活状态(true=使用,false=取消);持久化到 `root/active.json`
/// 未下载的模型不可激活(下载完成由 downloadModel 自动激活)。
Future<void> setActive(int datasetId, bool active) async {
final changed =
@@ -344,6 +344,7 @@ class ModelManager extends ChangeNotifier {
List<ModelCatalogItem> catalog) async {
final bundles = <ModelBundle>[];
for (final item in catalog) {
if (!_activeIds.contains(item.datasetId)) continue;
try {
final dir = await _modelDir(item.datasetId);
final file = File('${dir.path}/model.tflite');