basicsDidFullyDownloaded method
所有basic下载资源完成
Implementation
@override
basicsDidFullyDownloaded(bool isSuc, List<DownloadServiceItem> basicsBucket) {
if (localServerClientConfig.basicIsDown) {
return;
}
Map<String, dynamic> tmpBasicCache = {};
for (var loadItem in basicsBucket) {
for (var p in loadItem.filePath) {
String path =
LocalServerConfiguration.joinZipPathSync(loadItem.zipUrl, p);
File assetFile = File(path);
if (assetFile.existsSync()) {
var contents = assetFile.readAsBytesSync();
List<String> splits = assetFile.path.split('/');
String fileName = splits.last;
tmpBasicCache[fileName] = contents;
}
}
}
basicCache = tmpBasicCache;
LocalServerCacheBinderSetting().setBasicCache(basicCache);
localServerClientConfig.basicIsDown = isSuc;
_log(
'结束Basic下载,用时: ${(DateTime.now().millisecondsSinceEpoch - loadStartTime) / 1000}');
}