I have 100 images that I need to display in a list. I don't want to hard code all names.
How can I get the names of the images?
I want to have code like this:
final List<String> imageNames = await WhatEver.getNamesOfImagesInAssetsDirectory();
final widgets = imageNames.map((fileName) => Image.asset('images/${fileName}.png')).toList()
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…