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

Story View pauses when loading Second Story #149

Open
vasanthbalaji88 opened this issue Sep 29, 2022 · 0 comments
Open

Story View pauses when loading Second Story #149

vasanthbalaji88 opened this issue Sep 29, 2022 · 0 comments

Comments

@vasanthbalaji88
Copy link

@OverRide
void initState() {
super.initState();

initStoryPages(widget.index);

}

initStoryPages(int index) {
index = index;
for (int i = 0; i < widget.status[index].photoUrl.length; i++) {
storyItems.add(StoryItem.pageImage(
url: widget.status[index].photoUrl[i], controller: controller));
}
}

StoryView(
controller: controller,
storyItems: storyItems,
onComplete: () {
print('current state ${controller.playbackNotifier.value}'); // here it is printed as paused

                setState(() {
                  index += 1;
               
                  if (storyItems.isNotEmpty) {
                    storyItems.clear();
                  }
                  if (index < widget.status.length) {
                    initStoryPages(index);
                  }
                  if (index >= widget.status.length) {
                    Navigator.pop(context);
                  }
                });

              
              },

First story is loaded from initstate and then second story from status list index in oncomplete method, after loading it gets paused, i tried controller.play(), nothing happens , if i click on the image then story resumes. please help me how to resolve this issue.

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

1 participant