horizontal method
Implementation
@override
Widget horizontal(double aniValue, int index, double page, Widget child) {
delay = delay.clamp(0, 1 / shutterSize);
return LayoutBuilder(builder: (context, constraints) {
return Column(
children: List.generate(shutterSize, (indexSub) {
double intervalAni = 0;
if (page > index) {
intervalAni = Interval(indexSub * delay, 1 - (shutterSize - indexSub) * delay).transform(aniValue.abs());
// return SizedBox.shrink();
} else {
int sub = shutterSize - indexSub;
intervalAni = Interval(sub * delay, 1 - (shutterSize - sub) * delay).transform(aniValue.abs());
}
return ClipRect(
child: Align(
heightFactor: 1 / shutterSize,
alignment: FractionalOffset(0, indexSub / (shutterSize - 1)),
child: SizedBox(
height: constraints.maxHeight,
child: super.horizontal(intervalAni, index, page, child),
),
),
);
}),
);
});
}