Add SliverAnimatedGrid and AnimatedGrid#112982
Add SliverAnimatedGrid and AnimatedGrid#112982auto-submit[bot] merged 11 commits intoflutter:masterfrom
SliverAnimatedGrid and AnimatedGrid#112982Conversation
3f1b328 to
0552ff1
Compare
| /// Signature for the builder callback used by [AnimatedGrid]. | ||
| typedef AnimatedGridItemBuilder = Widget Function(BuildContext context, int index, Animation<double> animation); | ||
|
|
||
| /// Signature for the builder callback used by [AnimatedGridState.removeItem]. | ||
| typedef AnimatedGridRemovedItemBuilder = Widget Function(BuildContext context, Animation<double> animation); |
There was a problem hiding this comment.
Since the signatures are the same, do you think there is any benefit of creating one AnimatedItemBuilder and one AnimatedRemovedItemBuilder that both list and grid use?
We would probably have to add the new ones to AnimatedList, and deprecate the old ones... so if it feels like unnecessary churn we can have separate ones.
There was a problem hiding this comment.
I can explore this in the follow up refactor. I'll file an issue to track.
There was a problem hiding this comment.
In the meantime should I use AnimatedListItemBuilder here instead? That seems weird, though. I could just not use a typedef? Just trying to avoid introducing API surface that lasts only a until the next refactor, but I guess a typedef name is probably rarely actually used.
There was a problem hiding this comment.
Renamed to AnimatedItemBuilder, and we'll refactor AnimatedList later to take that instead.
| /// * [SliverGridDelegateWithFixedCrossAxisCount], which creates a layout with | ||
| /// a fixed number of tiles in the cross axis. | ||
| /// * [SliverGridDelegateWithMaxCrossAxisExtent], which creates a layout with |
There was a problem hiding this comment.
Offline we chatted about adding convenience constructors like count and extent in order to spin up a delegate for the user. Can you add those?
Reference: #113107
There was a problem hiding this comment.
I'm going to wait to do this, since it became clear that this and AnimatedList might need some refactoring to take a child builder delegate instead of just a builder function.
|
auto label is removed for flutter/flutter, pr: 112982, due to - Please get at least one approved review if you are already a member or two member reviews if you are not a member before re-applying this label. Reviewers: If you left a comment approving, please use the "approve" review action instead. |
|
auto label is removed for flutter/flutter, pr: 112982, due to Validations Fail. |
|
auto label is removed for flutter/flutter, pr: 112982, due to - The status or check suite Linux docs_test has failed. Please fix the issues identified (or deflake) before re-applying this label. |
7ef71df to
4ba7c77
Compare
|
Where can we find the preview release and date for |

Description
This adds two widgets, analogous to
SliverAnimatedListandAnimatedListwhich allow items that are added or removed from aSliverGridto be animated on add and remove.Added samples for each too.
grid2.mp4
Related Issues
Tests