TechnicJelle / BlueMapGUI

A GUI wrapper around the BlueMap CLI, mainly to make using BlueMap easier to use on single player worlds.
3 stars 0 forks source link

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

Open TechnicJelle opened 2 months ago

TechnicJelle commented 2 months ago

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.

https://github.com/TechnicJelle/BlueMapGUI/blob/9f3926b8fc3735021ce290d977d5775b4cec0cfd/lib/console.dart#L137-L145

TechnicJelle commented 2 months ago

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 commented 1 month ago

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.