v0.6.0
interactiveviewer_gallery
확대 및 드래그를 지원하는 이미지 및 비디오 미리보기 컴포넌트
68좋아요 92330일 다운로드135Pub 점수
AndroidiOSWebmacOSWindowsLinux
interactiveviewer 개선 사항: 이미지 및 비디오 미리보기, 두 손가락 제스처 확대, 더블클릭 확대, 좌우 전환. 이미지 미리보기, 비디오 미리보기, 이미지와 비디오 혼합 미리보기
{"sdk":"flutter"}{"sdk":"flutter"}아래는 영문 원문 스냅샷입니다. 최신 내용은 GitHub에서 확인하세요.
A flutter library to show picture and video preview gallery support
because the library is base on InteractiveViewer so require flutter verion above or equal 1.20.0
interactiveviewer_gallery: ${last_version}
Hero(
tag: source.url,
child: ${gridview item}
)
// DemoSourceEntity is your data model
// itemBuilder is gallery page item
void _openGallery(DemoSourceEntity source) {
Navigator.of(context).push(
HeroDialogRoute<void>(
// DisplayGesture is just debug, please remove it when use
builder: (BuildContext context) => InteractiveviewerGallery<DemoSourceEntity>(
sources: sourceList,
initIndex: sourceList.indexOf(source),
itemBuilder: itemBuilder,
onPageChanged: (int pageIndex) {
print("nell-pageIndex:$pageIndex");
},
),
),
);
}
Widget itemBuilder(BuildContext context, int index, bool isFocus) {
DemoSourceEntity sourceEntity = sourceList[index];
if (sourceEntity.type == 'video') {
return DemoVideoItem(
sourceEntity,
isFocus: isFocus,
);
} else {
return DemoImageItem(sourceEntity);
}
}
Comments and pr are welcome