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

snaplistController.setPosition don't have animation #19

Open
phattranky opened this issue May 26, 2019 · 2 comments
Open

snaplistController.setPosition don't have animation #19

phattranky opened this issue May 26, 2019 · 2 comments

Comments

@phattranky
Copy link

I try to using setPosition. The functional working well except it doesn't have animation. It just jumps directly to the position. I try to set snipDuration but not effect. Can anyone help me?. Thanks

@thanhnguyen1121
Copy link

Can you show me how to use Snaplistcontroller...plz

@nhank-group
Copy link

You can custom your own animation
In snaplist_view.dart file,
change:

bloc.explicitPositionChangeStream.listen((offset) {
      print("new offset: $offset");
      _controller.jumpTo(offset);
    });

to:

bloc.explicitPositionChangeStream.listen((offset) {
      _controller.animateTo(offset,
          duration: Duration(milliseconds: 300), curve: Curves.fastOutSlowIn);
    });

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

3 participants