mod: listener

Signed-off-by: bggRGjQaUbCoE <githubaccount56556@proton.me>
This commit is contained in:
bggRGjQaUbCoE
2025-02-25 12:38:20 +08:00
parent 0e69e23606
commit e236485bc7
29 changed files with 348 additions and 334 deletions

View File

@@ -127,10 +127,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
_animationController = AnimationController(
vsync: this,
duration: const Duration(milliseconds: 300),
)..addListener(() {
_transformationController!.value =
_animation?.value ?? Matrix4.identity();
});
)..addListener(listener);
if (widget.setStatusBar != false) {
setStatusBar();
@@ -141,6 +138,10 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
}
}
void listener() {
_transformationController!.value = _animation?.value ?? Matrix4.identity();
}
setStatusBar() async {
if (Platform.isIOS || Platform.isAndroid) {
await StatusBarControl.setHidden(
@@ -155,7 +156,7 @@ class _InteractiveviewerGalleryState extends State<InteractiveviewerGallery>
widget.onClose?.call(true);
_player?.dispose();
_pageController?.dispose();
_animationController.removeListener(() {});
_animationController.removeListener(listener);
_animationController.dispose();
if (widget.setStatusBar != false) {
if (Platform.isIOS || Platform.isAndroid) {