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 textDirection = Directionality.of(context);
final sectionChildIndex = listIndex - sectionFirstIndex; final sectionChildIndex = listIndex - sectionFirstIndex;
final row = sectionChildIndex == 0 ? null : rows[sectionChildIndex - 1]; final row = sectionChildIndex == 0 ? null : rows[sectionChildIndex - 1];
final sectionGridIndex = row != null ? (sectionChildIndex + 1) * columnCount + row.firstIndex : sectionChildIndex * columnCount;
return buildSectionWidget( return buildSectionWidget(
context: context, context: context,
section: section, section: section,
sectionGridIndex: listIndex * columnCount, sectionGridIndex: sectionGridIndex,
sectionChildIndex: sectionChildIndex, sectionChildIndex: sectionChildIndex,
itemIndexRange: () => row == null ? const Tuple2(0, 0) : Tuple2(row.firstIndex, row.lastIndex + 1), itemIndexRange: () => row == null ? const Tuple2(0, 0) : Tuple2(row.firstIndex, row.lastIndex + 1),
sectionKey: sectionKey, sectionKey: sectionKey,

View file

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