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

No default duration in AnimationController #34

Open
thitlwincoder opened this issue Jan 11, 2025 · 1 comment
Open

No default duration in AnimationController #34

thitlwincoder opened this issue Jan 11, 2025 · 1 comment

Comments

@thitlwincoder
Copy link

E/flutter (29214): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: AnimationController.forward() called with no default duration.
E/flutter (29214): The "duration" property should be set, either in the constructor or later, before calling the forward() function.
E/flutter (29214): #0 AnimationController.forward. (package:flutter/src/animation/animation_controller.dart:487:9)
E/flutter (29214): #1 AnimationController.forward (package:flutter/src/animation/animation_controller.dart:494:6)
E/flutter (29214): #2 _FlutterStoryPresenterState._resetAnimation (package:flutter_story_presenter/src/story_presenter/story_view.dart:209:27)
E/flutter (29214): #3 _FlutterStoryPresenterState._playNext (package:flutter_story_presenter/src/story_presenter/story_view.dart:382:5)
E/flutter (29214): #4 _FlutterStoryPresenterState.videoListener (package:flutter_story_presenter/src/story_presenter/story_view.dart:293:7)
E/flutter (29214): #5 ChangeNotifier.notifyListeners (package:flutter/src/foundation/change_notifier.dart:437:24)
E/flutter (29214): #6 ValueNotifier.value= (package:flutter/src/foundation/change_notifier.dart:559:5)
E/flutter (29214): #7 VideoPlayerController._updatePosition (package:video_player/video_player.dart:776:5)
E/flutter (29214): #8 VideoPlayerController.seekTo (package:video_player/video_player.dart:662:5)
E/flutter (29214):
E/flutter (29214):

@henoktadesse
Copy link

henoktadesse commented Jan 29, 2025

This is far from solving the issue, but for now as a workaround, you can blindly give Duration for the animation controller, adding duration: _totalAudioDuration??Duration(seconds: 3) inside FlutterStoryPresenter class.

so the code will look something like

        _animationController ??= AnimationController(
          vsync: this,
          duration: _totalAudioDuration??Duration(seconds: 3)//add this
        );

you might wanna do this on all the 3 places where AnimationController is set.

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