[英]How Initialize a list of type File in Dart/Flutter
我有這個變量;
io.File pic1, pic2, pic3, pic4;
取而代之的是,我想要一個圖片列表(文件類型),以便以后可以遍歷它。 但我不知道如何做到這一點。
因為使用String
會是;
List<String> lst = [ 'a', 'b', 'c' ];
File
類型會怎么樣? 謝謝!
所以我剛剛解決了這個問題;
List<io.File> test;
所以我可以使用Add()
方法保存圖片,以便以后遍歷它。
test.add(io.File(tempImg.path));
...
int count = 1;
for (io.File picture in test) {
FirebaseStorage.instance
.ref()
.child(count.toString())
.putFile(picture);
count++;
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.