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