imageFromId function

FileImage? imageFromId(
  1. String storageId
)

根据Storage ID获取图像

storageId 图像的存储ID 返回 FileImage 对象,如果文件不存在则返回null

Implementation

FileImage? imageFromId(String storageId) {
  String destPath = FilePath.imagePath + storageId;
  print('load image from -> $destPath');
  File file = File(destPath);
  if (file.existsSync()) {
    return FileImage(file);
  } else {
    print('image file not exists!');
    return null;
  }
}