vertical method
Implementation
Widget vertical(double aniValue, int index, double page, Widget child) {
double gauss = math.sin(math.pi * aniValue);
if (page == index) {
current = index;
return child;
} else if (page > index) {
if (current == index) {
return child;
}
return LayoutBuilder(builder: (context, constraints) {
return Transform.translate(
offset: Offset(0, -constraints.maxWidth / 4 * gauss),
child: child,
);
});
} else {
if (current == index) {
return child;
}
return LayoutBuilder(builder: (context, constraints) {
return Transform.translate(
offset: Offset(0, constraints.maxWidth / 4 * gauss),
child: child,
);
});
}
}