PhotoViewGalleryPageOptions _buildItem(BuildContext context, int index) {
final item = (widget.bloc.state as AssetPhotoInfo).images[index].thumbDataWithSize(width, height).;
return PhotoViewGalleryPageOptions(
imageProvider: MemoryImage(item),
minScale: PhotoViewComputedScale.contained * 1,
maxScale: PhotoViewComputedScale.covered * 2,
); }
代码中item是从相册获取的图片,这个图片是异步获取的,所以得到的值是future<Uint8List>,该类型如果放在memoryImage中会报错,试了多种方法依然无果,futureBuilder由于返回的是widget,也不适用