mosaic animation fix

This commit is contained in:
Thibault Deckers 2022-10-01 12:13:02 +02:00
parent f687622997
commit e9865aab96
2 changed files with 3 additions and 2 deletions

View file

@ -103,10 +103,11 @@ class MosaicSectionLayoutBuilder<T> extends SectionLayoutBuilder<T> {
final textDirection = Directionality.of(context);
final sectionChildIndex = listIndex - sectionFirstIndex;
final row = sectionChildIndex == 0 ? null : rows[sectionChildIndex - 1];
final sectionGridIndex = row != null ? (sectionChildIndex + 1) * columnCount + row.firstIndex : sectionChildIndex * columnCount;
return buildSectionWidget(
context: context,
section: section,
sectionGridIndex: listIndex * columnCount,
sectionGridIndex: sectionGridIndex,
sectionChildIndex: sectionChildIndex,
itemIndexRange: () => row == null ? const Tuple2(0, 0) : Tuple2(row.firstIndex, row.lastIndex + 1),
sectionKey: sectionKey,

View file

@ -85,7 +85,7 @@ abstract class SectionLayoutBuilder<T> {
final durations = context.watch<DurationsData>();
return AnimationConfiguration.staggeredGrid(
position: index,
columnCount: columnCount,
columnCount: tileLayout == TileLayout.mosaic ? columnCount * 2 : columnCount,
duration: durations.staggeredAnimation,
delay: tileAnimationDelay,
child: SlideAnimation(