-
Notifications
You must be signed in to change notification settings - Fork 40
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
Feature Request: Scrollable LayoutGrid with Builder Functionality #94
Comments
I am searchig the same functionality, like the CSS grid or flex system, where the row elements expands to the height of the tallest row element, would be very useful if this package had some similar functionality. |
I was about to make the same request, it would be very useful, specially for not having to set an specific row number. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I am exploring this package as a potential alternative to
flutter_staggered_grid_view
, which no longer supports scrollable staggered grid views (it supports staggered grids, but these are not buildable or scrollable).This package allows full control over placing items in rows and columns, which is invaluable for creative layouts. However, I couldn't find any option for using a Builder, which is a critical feature for my use case.
Ideally, a
LayoutGrid
builder should operate like other builders in Flutter. Instead of receiving a list of children, it would rather have aWidget Function(BuildContext context, int index)
parameter to dynamically build its children. Using this approach, the Grid could build children only when they are in the viewport. This also means, the Grid would be scrollable and transform it into aLayoutGridView
, based on Flutter's naming convention, where Views are scrollable. This functionality is crucial for larger grids with many children, as building all children at all times can lead to significant performance issues.The usual practice in Flutter for lists and grids is to first create a Sliver version (a builder without a
ScrollView
), then provide a version wrapped in aBoxScrollView
. For example, aListView
is aSliverList
wrapped in aBoxScrollView
.The API might look similar to this:
SliverLayoutGrid
widget, which is a Sliver that uses aSliverChildBuilderDelegate
to build its children.LayoutGridView
widget which is aBoxScrollView
that internally uses aSliverLayoutGrid
. It could come with both a children list parameter and a.builder
constructor. This would not replace the usualLayoutGrid
, which is not scrollable.Incorporating this functionality may entail a significant refactor, and I'm unsure about its feasibility with the current layout algorithm (since
flutter_staggered_grid_view
removedStaggeredGridView
due to performance issues with its layout algorithm). It also deviates somewhat from a pure CSS grid. However, this enhancement would make the package incredibly versatile.The key use case for this feature is to create infinite, paginated, quilted/staggered image layouts. Pagination can be added externally as long as a Sliver version with a builder is available. I typically use
infinite_scroll_pagination
to enable this functionality with any Sliver.The text was updated successfully, but these errors were encountered: