Skip to content
This repository has been archived by the owner on Sep 24, 2023. It is now read-only.

[Feature Request] Scroll to programatically #3

Closed
johanlantz opened this issue Mar 14, 2020 · 6 comments
Closed

[Feature Request] Scroll to programatically #3

johanlantz opened this issue Mar 14, 2020 · 6 comments
Labels
enhancement New feature or request

Comments

@johanlantz
Copy link

Thanks for a really cool widget!

I am trying to figure out a way to scroll to a _position programmatically but I have not managed to solve it.

For the scenario I had in mind I would need a way to programmatically move to specific offsets of the DiagonalScrollView when certain things happen but I am not sure how to accomplish that.

All suggestions are welcome :-)

@RanfiCD RanfiCD added the enhancement New feature or request label Mar 16, 2020
@RanfiCD
Copy link
Owner

RanfiCD commented Mar 16, 2020

Hi!

Currently there is no internal way to do it programmatically.

I will take advantage of some time in my Coronavirus quarantine to create a basic controller that allows this scenario.

Thank you for the suggestion!

@johanlantz
Copy link
Author

That sounds great. I have a pet project I would like to try (also during the Corona quarantine) and your plugin looks really promising for what I am thinking about.

Thanks for accepting the idea.

@RanfiCD
Copy link
Owner

RanfiCD commented Mar 19, 2020

Hi!
I've published a new version, could you try it out?

@johanlantz
Copy link
Author

Cool,

I have tried but I can't get it to move. I have just stored the controller from the onCreated callback and then I try to use moveBy when pressing a button but it does not move. Perhaps I am using it wrong?

The sample code based on your example is here:
https://github.com/johanlantz/flutter_diagonal_scroll/blob/master/lib/main.dart

@RanfiCD
Copy link
Owner

RanfiCD commented Mar 20, 2020

Hi!

I've tried your example and now it's working fine. Turns out I was using a counterintuitive approach by moving the origin using negative values.

Can you try it again?

Thanks!

@johanlantz
Copy link
Author

Amazing, was going to ask for animation support but saw you already implemented that.

It looks great. If I have time to start my side project I might have more ideas but for now this looks really nice.

Thanks for sharing and have a nice weekend (even if in quarantine :-), we are a bit restless here in Barcelona as well)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants