feat: custom horizontal preview

Closes #117

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-01-08 19:13:37 +08:00
parent 0b9d4d970a
commit 8d4294ba75
22 changed files with 255 additions and 97 deletions

View File

@@ -42,8 +42,11 @@ class InteractiveviewerGallery<T> extends StatefulWidget {
this.minScale = 1.0,
this.onPageChanged,
this.onDismissed,
this.setStatusBar,
});
final bool? setStatusBar;
/// The sources to show.
final List<String> sources;
@@ -108,7 +111,9 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
});
currentIndex = widget.initIndex;
setStatusBar();
if (widget.setStatusBar != false) {
setStatusBar();
}
}
setStatusBar() async {
@@ -125,8 +130,10 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
_pageController?.dispose();
_animationController.removeListener(() {});
_animationController.dispose();
if (Platform.isIOS || Platform.isAndroid) {
StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
if (widget.setStatusBar != false) {
if (Platform.isIOS || Platform.isAndroid) {
StatusBarControl.setHidden(false, animation: StatusBarAnimation.FADE);
}
}
for (int index = 0; index < widget.sources.length; index++) {
CachedNetworkImageProvider(_getActualUrl(index)).evict();