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

Reorder on Cross Axis change #114

Open
clragon opened this issue Feb 17, 2025 · 0 comments
Open

Reorder on Cross Axis change #114

clragon opened this issue Feb 17, 2025 · 0 comments

Comments

@clragon
Copy link

clragon commented Feb 17, 2025

Preamble

This library is very important because it provides something that the framework does not:
Animating items when they move between rows of a Grid.

However, at the current moment, these animations only take place when adding, removing or reordering items.
A crucial place of animation is also when the cross axis count changes.

Problem

The sample app uses the following Sliver Grid Delegate:

const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 4),

This delegate is static in the sense that its cross axis count is always 4.
Given an app that runs on different devices with different screen widths, we would most likely rather use a delegate as such:

const SliverGridDelegateWithMaxCrossAxisExtent(maxCrossAxisExtent: 200),

Which dynamically determines the cross axis count based on the available space.
There are other ways to achieve this same behaviour.

When the layout resizes, the cross axis count changes, but it will snap into place.

Demonstration

Below is a video demonstrating how items do currently not animate when they are moved to a different row of the grid due to the cross axis count changing:

explorer_9H7ZeJCYks.mp4

Conclusion

If the current implementation was to be expanded to support animating items in such a manner,
it would greatly benefit responsive applications looking to use this library.

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