使用Firebase的Flutter中的LinearProgressIndicator

时间:2018-11-28 19:42:19

标签: firebase flutter progress-bar firebase-storage

如何使用LinearProgressIndicator制作带有来自Firebase Storage的下载数据的下载栏? 我当前正在使用的功能:

Future<int> downloadBuscaDB() async{
 String path = await dbManager.localPathFiles();
 String fileDBZip = ConstData.dbZip;
 FirebaseStorage storage = new FirebaseStorage();
 StorageReference ref = storage.ref().child(fileDBZip);
 StorageFileDownloadTask storageFileDownloadTask = ref.writeToFile(File('$path/$fileDBZip'));
 FileDownloadTaskSnapshot fileDownloadTaskSnapshot = await storageFileDownloadTask.future;
 int bCount = fileDownloadTaskSnapshot.totalByteCount;
 return bCount;
}

0 个答案:

没有答案