Is your feature request related to a problem? Please describe.
I'm building some kind of app internal gallery, and it has videos
I've tried to just include PhotoView widget in PageController, but with this approach PhotoView doesn't work at all
Describe the solution you'd like
I want PhotoViewGallery.builder to be able to accept non PhotoView widget
Best api, IMHO, would be like following:
PhotoViewGallery.builder(
pageController: PageController(initialPage: initialIndex),
itemCount: assets.length,
builder: (_, i) =>
PhotoViewGalleryPageOptions(
imageProvider: assets[i].isVideo ? null : assets[i].image,
notImage: assets[i].isVideo ? assets[i].videoWidget : null,
),
),
I've found PhotoView.customChild but I want video widget appear as is, taking whole available space and no scaling
Perhaps a new constructor such as PhotoViewGalleryPageOptions.customChild would help you.
Yeah, I will try to implement it
UPD: well, no luck, feel like an idiot now :D
@rostopira added custom child support on #131
PhotoViewGalleryPageOptions.customChild(
child: Container(
width: 300,
height: 300,
child: SvgPicture.asset(
item.resource,
height: 200.0,
),
),
childSize: const Size(300, 300),
initialScale: PhotoViewComputedScale.contained,
minScale: PhotoViewComputedScale.contained * (0.5 + index / 10),
maxScale: PhotoViewComputedScale.covered * 1.1,
heroTag: item.id,
)
Thank you for this change and awesome plugin!
I will release it as 0.3.1
Update: done
Most helpful comment
@rostopira added custom child support on #131