Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onFinishPlaying is being called twice #11

Open
d-apps opened this issue Nov 30, 2021 · 2 comments
Open

onFinishPlaying is being called twice #11

d-apps opened this issue Nov 30, 2021 · 2 comments

Comments

@d-apps
Copy link

d-apps commented Nov 30, 2021

I am having a problem on my app where the init method is being called twice, after some tests I realized that onFinishPlyaing is being called twice, could you help me with that? Thank you.

ImageSequenceAnimator(
                                "assets/animation",
                                "frame_",
                                0,
                                0,
                                "png",
                                22,
                                fps: 20,
                                onFinishPlaying: (imageSequenceAnimatorState){

                                  print("onFinishPlaying");
                                  splashController.init();

                                },
                              ),

onFinishPlaying // it prints twice

flutter doctor -v

[✓] Flutter (Channel stable, 2.5.3, on macOS 11.6 20G165 darwin-arm, locale en-BR)
• Flutter version 2.5.3 at /Users/djalma/development/flutter
• Upstream repository https://github.com/flutter/flutter.git
• Framework revision 18116933e7 (7 weeks ago), 2021-10-15 10:46:35 -0700
• Engine revision d3ea636dc5
• Dart version 2.14.4

[✓] Android toolchain - develop for Android devices (Android SDK version 31.0.0)
• Android SDK at /Users/djalma/Library/Android/sdk
• Platform android-31, build-tools 31.0.0
• ANDROID_HOME = /Users/djalma/Library/Android/sdk
• Java binary at: /Applications/Android Studio.app/Contents/jre/Contents/Home/bin/java
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)
• All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS
• Xcode at /Applications/Xcode.app/Contents/Developer
• Xcode 13.1, Build version 13A1030d
• CocoaPods version 1.10.2

[✓] Chrome - develop for the web
• Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2020.3)
• Android Studio at /Applications/Android Studio.app/Contents
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 11.0.10+0-b96-7249189)

[✓] Connected device (3 available)
• iPad Pro (9.7-inch) (mobile) • 0C8AB907-97CE-4FD7-B4EC-A38A33242FDC • ios • com.apple.CoreSimulator.SimRuntime.iOS-15-0 (simulator)
• macOS (desktop) • macos • darwin-arm64 • macOS 11.6 20G165 darwin-arm
• Chrome (web) • chrome • web-javascript • Google Chrome 96.0.4664.55

• No issues found!

@d-apps
Copy link
Author

d-apps commented Nov 30, 2021

As workaround I had to create a bool variable to make sure my init method will called only once.

bool onFinishPlayingCalled = false;

Screen Shot 2021-11-30 at 16 44 59

@aliyigitbireroglu
Copy link
Owner

Thank you for the feedback. I will take a look at this right away.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants