story icon indicating copy to clipboard operation
story copied to clipboard

indicatorAnimationController not pause when set value to IndicatorAnimationCommand.pause

Open Alemartech opened this issue 2 years ago • 8 comments

Alemartech avatar Jan 07 '23 22:01 Alemartech

same issue

gideonoyekale avatar Jan 15 '23 17:01 gideonoyekale

@Alemartech @gideonoyekale Can you give me a sample code of the case that does not work?

santa112358 avatar Jan 27 '23 11:01 santa112358

@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

TitikUniverse avatar Feb 14 '23 22:02 TitikUniverse

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

TitikUniverse avatar Feb 14 '23 22:02 TitikUniverse

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}');

TitikUniverse avatar Feb 14 '23 22:02 TitikUniverse

+1

heshesh2010 avatar Apr 01 '23 05:04 heshesh2010

same here

mirsaiddev avatar May 27 '23 20:05 mirsaiddev

Facing Same issue on web as well

Rgada28 avatar May 29 '24 12:05 Rgada28