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

SelectedItemAnchor.START gets stuck on last item #39

Open
lukepighetti opened this issue Mar 28, 2024 · 1 comment
Open

SelectedItemAnchor.START gets stuck on last item #39

lukepighetti opened this issue Mar 28, 2024 · 1 comment

Comments

@lukepighetti
Copy link

lukepighetti commented Mar 28, 2024

package tries to animate to second to last, but it really needs to switch to SelectedItemAnchor.END when at the last item

gets-stuck-on-last-item.mp4
@lukepighetti
Copy link
Author

this is a quick fix i came up with


                      listViewPadding: EdgeInsets.symmetric(horizontal: 24) +
                          // https://github.com/MSVCode/scroll_snap_list/issues/39
                          EdgeInsets.only(
                            right: _shim(
                              MovementCard.width,
                              24,
                              MediaQuery.sizeOf(context).width,
                            ),
                          ),

double _shim(double cardWidth, double horizontalPadding, double viewportWidth) {
  return viewportWidth - cardWidth - horizontalPadding;
}

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

1 participant