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

Fix scroll-to-bottom FAB scrolling behaviour (teleportation) #17

Open
TechnicJelle opened this issue Sep 3, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@TechnicJelle
Copy link
Owner

TechnicJelle commented Sep 3, 2024

Currently, the animateTo function does not always properly scroll all the way to the actual bottom, so there is a .then(() => _scrollToBottom()) call after it.
This should not be necessary.

BlueMapGUI/lib/console.dart

Lines 137 to 145 in 9f3926b

_scrollController
.animateTo(
_scrollController.position.maxScrollExtent,
duration: Durations.medium4,
curve: Curves.easeInOut,
)
.then((_) {
_scrollToBottom();
});

@TechnicJelle TechnicJelle added the bug Something isn't working label Sep 3, 2024
@TechnicJelle TechnicJelle added this to the 1.0: First stable release milestone Sep 3, 2024
@TechnicJelle
Copy link
Owner Author

TechnicJelle commented Sep 6, 2024

I think I know what might be happening...
When you click the FAB, it reads out the maxScrollExtent, and starts scrolling to that exact pixel value.
But when new stuff gets added to the ListView, that gets added after that pixel value.
So it scrolls to the position that used to be the bottom, when the FAB was clicked, instead of to the actual bottom at the end-moment of the animation.

I still do not know how to properly solve this...

I've found this solution: https://stackoverflow.com/a/74134507/8109619, but that's also far from ideal, due to the linear scroll.
And honestly, I'd rather keep the current solution that teleports at the end-moment of the animation, instead.

@TechnicJelle TechnicJelle removed this from the 1.0: First stable release milestone Sep 8, 2024
@TechnicJelle
Copy link
Owner Author

I've decided this bug is not important enough to fix before 1.0.
I hope to be able to find a solution to this at some point in the future.

@TechnicJelle TechnicJelle changed the title Fix scroll-to-bottom FAB Fix scroll-to-bottom FAB scrolling behaviour (teleportation) Nov 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant