You converted one file, it is not a list of images. If you try to load this image to a widget, you can try to use Image.file
:
Image.file(
compressedFile,
);
In your case it would be something like this:
final List<File> images = [];
for (int i = 0;i < widget.image.length;i++) {
final path = await FlutterAbsolutePath.getAbsolutePath(
widget.image[i].identifier,
);
File compressedFile = await FlutterNativeImage.compressImage(
path,
quality: 90,
);
images.add(compressedFile);
}
And convert it to list:
images.map((imageFile) => Image.file(imageFile)).toList();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…