story
story copied to clipboard
indicatorAnimationController not pause when set value to IndicatorAnimationCommand.pause
same issue
@Alemartech @gideonoyekale Can you give me a sample code of the case that does not work?
@santa112358 santa112358 Same issue. Despite the fact that in initState I immediately initialized as "pause", the playback of the story began immediately. It's impossible to stop it.
iPhone 12 (iOS 16.3)^ Flutter 3.7.2
@override
void initState() {
super.initState();
initializeDateFormatting();
indicatorAnimationController = ValueNotifier<IndicatorAnimationCommand>(IndicatorAnimationCommand.pause);
}
StoryPageView(
initialPage: widget.index,
indicatorPadding: const EdgeInsets.symmetric(vertical: 52, horizontal: 8),
indicatorAnimationController: indicatorAnimationController,
onPageLimitReached:() => Navigator.pop(context),
pageLength: feedStories.length,
storyLength: (pageIndex) => feedStories[pageIndex].items.length,
itemBuilder: (context, pageIndex, storyIndex) {
final story = feedStories[pageIndex].items[storyIndex];
final isVideo = _isVideo(story.contentUrl);
return Stack(
fit: StackFit.expand,
children: [
Container(
color: Colors.black,
),
if (isVideo) VideoItem(
videoUrl: story.contentUrl,
)
else StoryImage(
key: ValueKey(story.contentUrl),
imageProvider: CachedNetworkImageProvider(
story.contentUrl
),
)
],
);
},
)
write to me at [email protected] if you need more details or reply to this comment
I am 100% sure that if you do not use the Story Image() widget, then it is impossible to stop scrolling through stories. And if you use this widget, then at least until the history is loaded - everything is stopped, but stop through the indicatorAnimationController.value = IndicatorAnimationCommand.pause;
is not possible
I just found out that after executing my code, the story starts over, but still keeps replaying. However, this behavior is typical only for the first pause call. On the second and subsequent runs of my code, nothing happens (it doesn't even rewind to the beginning)
@override
void initState() {
super.initState();
indicatorAnimationController = ValueNotifier<IndicatorAnimationCommand>(IndicatorAnimationCommand.resume);
}
...
indicatorAnimationController.value = IndicatorAnimationCommand.pause;
GoRouter.of(context).push('/${feedStories[pageIndex].author.nickname}');
+1
same here
Facing Same issue on web as well